Page 1 of 1

Order of Dimensions in View and Expand Function

Posted: Tue Jun 24, 2014 8:30 pm
by PlanningDev
We are trying to create a generic cube exporter that essentially uses a fake cube to populate a bunch of variables generically named V1, V2, etc.

Using a while loop and TABDIM we can construct the Variables for each dimension related to a cube and then use Expand to convert the string to actual values.

While the solution is working the dimensions seem to come out of order. Everything is shifted by 1. If the first dimension of the cube was Months and the second was Versions we are seeing our string for expand built as "%V1%", "%V2%". However, V1 is evaluating to the Versions dimension. Anyone know why this would occur? We built a TI manually using the view and the variables show up in the order we would have expected. Only when we try to Expand our string do we see the values getting shifted.

Re: Order of Dimensions in View and Expand Function

Posted: Tue Jun 24, 2014 8:32 pm
by jim wood
Have you tried downloading and using the Bedrock processes? They're not a bad place to start,

Jim.

Re: Order of Dimensions in View and Expand Function

Posted: Tue Jun 24, 2014 8:51 pm
by declanr
Not sure how you are doing the export exactly but there have often been cases (in various versions of TM1) of generic export TIs having issues with re-ordered cubes. You can get around that (and I tend to put this in TIs now as an OCD force of habit) by cycling on tabdim and setting each dimension as a sequential order of row in your viewcreate statement.

e.g.

Code: Select all


iCount = 1;
sDim = TabDim ( sCub, iCount );
While ( sDim@<>'' );
          ViewRowDimensionSet ( sCub, sView, sDim, iCount );
          iCount = iCount + 1;
          sDim = TabDim ( sCub, iCount );
End;

Not sure why you are using an extra cube for the export though, I've generally just used generic TIs.

Re: Order of Dimensions in View and Expand Function

Posted: Tue Jun 24, 2014 9:08 pm
by PlanningDev
Thanks for the info..working on it now.

We aren't using an extra cube, just a generic cube that has 15 dimensions or so. This way the variables tab has enough variables in it to cover any cube we may export from the process.

Re: Order of Dimensions in View and Expand Function

Posted: Tue Jun 24, 2014 9:56 pm
by PlanningDev
For some reason when we start the source view from the cube we want to export the columns come out in order. When we use a dummy cube and a while loop to assign variables V1-n the come out of order. It's behaving oddly when we switch the view from one cube to another.