0

There are two parts of a TI process that confounds me to no end.

  1. This process allegedly creates new dimensions for a cube (using attributes of some element) without a data source. But all I can see is that it creates the dimension name and right away moves on to adding an element to this dimension. How is that even possible, unless someone already created a dimension of that name, which is very unlikely? (Screenshot below)

Creating dimension without data source

  1. This process is also said to add these newly created dimensions to an existing cube. How can that be performed? How will the existing data in that cube accomodate the new dimensions?
Kenzo_Tenma
  • 11
  • 1
  • 8
  • My understanding is that you cannot add dimensions to a cube. You need to create a new cube. Not to mention all of the feeders and rules will fail when it has a different number of dimensions – Nick.Mc Jul 26 '16 at 10:13
  • With regards to your other question.... who knows.... did you check to see if dimensions by those names already exist? You might fund they were pre created precisely for this reason, – Nick.Mc Jul 26 '16 at 10:14
  • Yeah, isn't that why they add new elements to the measure dimension instead when there's a need for adding more dimensionality to a cube? – Kenzo_Tenma Jul 26 '16 at 10:50
  • Hmmm.. I'll get to the bottom of it. But going by what the TI's purported to do, and the comments in the code, the dimension gets named just right there. Also, the wrapper process of this TI process doesn't create this dimension either. – Kenzo_Tenma Jul 26 '16 at 10:52

1 Answers1

0

This process allegedly creates new dimensions for a cube

No, it doesn't, nor does it claim to. The commentary in the code doesn't say anything about creating a dimension, it says Create Dimension Name. That is, it is just working out what the dimension name should be for use in the DimensionElementInsert function. The attribute provides the base name for a dimension that should already exist. (Though it's something of an article of faith given that the DimensionExists function isn't called at any point. Of course, given the complete absence of error handling in TI there isn't much you could do about it even if it didn't exist.) The section of code above the one you have highlighted does NOT attempt to create a dimension - the DimensionCreate function s not called anywhere here - it simply parses the attribute value, character by character, replacing any spaces with underscores (after sticking rp_ in front of it) to get the correct dimension name.

Another attribute defines what the top element in the dimension should be. If that element does not exist, the code that you have highlighted creates it.

The comment by Nick McDermaid is correct; you CANNOT add dimensions to an existing cube. You can export the data, destroy the cube, build a new cube with the same name but with extra dimension(s), and import the old data into it, but that's different. And the import process would need to have some code to select the appropriate element(s) of the new dimension(s) to use when writing the data.

isn't that why they add new elements to the measure dimension instead when there's a need for adding more dimensionality to a cube

Measures dimensions do not exist, as such, in TM1. A dimension of a cube can be flagged as a "measure" dimension for communication with other systems that may need one, but they have no impact within TM1 itself. For convenience the last dimension of a cube is often referred to as "the measures dimension" but it has no significance beyond being a convenient name for identifying the dimension that holds the metrics that are stored in the cube.

More importantly, dimensions are dimensions, elements are elements. When you add elements to a dimension you are NOT changing the dimensionality of the cube. (You may (and probably will be) be changing the sparsity, but that's a completely different concept.) The only way to do that is by adding new dimensions to the cube which, as noted above, you can't actually do; you are instead destroying the old cube and replacing it with a new one which just happens to have the same name and a different number of dimensions. Given that doing so will trash every single slice, active form, view etc that was ever written for the cube, it's not something that is, or should be, done very often in practice.

Alan K
  • 1,957
  • 3
  • 19
  • 30
  • Thanks Alan, Nick! There was indeed a process tucked away in there which recreated the cube with the new dimensions (using attributes of elements belonging to a dimension), before this cube load process could load values into the cube. You're right - It was just the creation of the dimension name that was specified in the comment. – Kenzo_Tenma Aug 18 '16 at 11:20