Page 1 of 1

Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 1:26 pm
by CoN73mP7
Hi,

I'm building Dimensions from a Star-Scheme. So at the end of this process, I've got a number of Dimensions and want to add them to a Cube. How should I do this?

I can't build a TI-Process, because I don't know the number of Dimensions I need to add in the CubeCreate() Function.

Greetings
Alex

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 1:53 pm
by jim wood
You can't add dimensions to cubes for a starter for 10. You'll need to recreate the cube every time. You'll then have to consider how I can export and remap data previously in the cube.

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 2:01 pm
by CoN73mP7
I think we are talking about different things.

I DO NOT have an existing cube.

I have created dimensions and in the next step want to create a cube with them. The only problem: I don't know how many dimensions when writing the process.

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 3:13 pm
by David Usherwood
Given you have a relational source, would a sensible approach be to write a DISTINCT query of some kind to give you the _names_ of the dimensions, and use that to populate the parameters of CubeCreate? But you'd probably need to have a set of IFs matching to each of the _dimensionality_ possibilities ie if you have 10 dimensions, cubecreate with 10 values, etc. Sounds quite messy to me.
To be really fancy you could look at Steve Rowe's use of Expand in the Hints and Tips. But it sounds to me as if the requirement which has come to you needs challenging.

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 3:23 pm
by CoN73mP7
Thanks for your answer, I've got no problems with the names of the dimensions. I could pass them as parameters. But I don't know the number of dimensions. I'm building about a hundred cubes with different count of dimensions. i can't make a process for each number of dimensions.

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 4:23 pm
by David Usherwood
No....
But you can build a process which has a cubecreate command for each _number_ of dimensions with which you need to work, and wrap IF tests round them
We've had to do this many times in the past, when writing generic version rollover TIs - CELLPUTNs for each cube. At least in that case we had the cubes so could find out the dimension count.
If you can generate a query with the cube and dimension names I can't see an issue with a set of CUBECREATES based on how many dimensions you need. You could even add the dimension count in your query :)

Re: Creating a cube with a variable number of Dimensions

Posted: Tue Sep 06, 2011 9:53 pm
by paulsimon
Hi

The nested IF approach in TI is the one I would go for.

Other approaches include the use of the TAB_CREATE16 macro from VBA or the use of the TM1 API be it VB, C or Java.

The requirement to be able to create multiple cubes all with different numbers of dimensions does strike me as a little unusual. Are you writing some sort of generic production deployment tool?

Regards

Paul Simon