Page 1 of 1

Dimension Order in ViewCreate

Posted: Thu Jul 14, 2011 4:07 pm
by mattgoff
I'm working on a snapshot script, but I'm running an issue with ViewCreate. My algorithm goes like this:

Parent Process
  1. Prolog: Create new version element as a target.
  2. Prolog: Create tmp subset in version dim with source element.
  3. Epilog: Cycle through cubes looking for ones with version dim.
  4. Epilog: When one found, create a view, assign source version subset, and call child process.
Child Process
  1. Prolog: DataSourceNameForServer, DataSourceNameForClient, DataSourceType, and DataSourceCubeview (all based on view created in parent process).
  2. Data: Do a CellPutN/S (lots of IFs, one for each number of dims to brute force get the syntax right.
Everything seems like it's working, but I'm getting errors on the CellPutN/S for every row of source data. The error logs are full of "invalid key" errors, and it looks like it's because the dimensions are in a random order to TI as a datasource, not in index order, and the mixed-up dimensions hit the CellPutN/S and fail. When you create a view manually, the dimensions are in index order.

I've tried looping through the dims and using ViewRowDimensionSet to try to put them in the right order, but that had no effect. I'm about to write a new loop to create subsets in each dim and assign to the view in order (vs. leaving as "All"), but as I do that I was wondering if anyone has dealt with this before. Even if it's a bug, I have to work around it....

I know the BKM on this is to export to a file and reimport, but I/O is a real bottleneck in our system and this process will run at least an order of magnitude faster if I can do without ASCIIOutput.

Matt

Re: Dimension Order in ViewCreate

Posted: Thu Jul 14, 2011 4:24 pm
by lotsaram
May not be what you want to hear but have a look here http://www.tm1forum.com/viewtopic.php?f=18&t=5284

Re: Dimension Order in ViewCreate

Posted: Thu Jul 14, 2011 4:28 pm
by mattgoff
Balls.

How did I miss that thread? Sheesh! Thx, lotsa.