Page 1 of 1

determine whether a particular dimension belongs to a cube

Posted: Fri Jul 04, 2014 6:55 am
by wang_chris
I have a process attemping to process all user-created cubes which include a particular dimension, such as 'Year'.

But I can't find a function in TM1 to determine whether a particular dimension (say 'Year') is the dimension of a cube. Can someone help?



Many thanks.

Regards,
Chris

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 7:02 am
by hyunjia
Yes , there's no such function in TM1 , you have to loop throught all dimesnion within a cube using TABDIM , and try to locate the dimesnion you want .

wang_chris wrote:I have a process attemping to process all user-created cubes which include a particular dimension, such as 'Year'.

But I can't find a function in TM1 to determine whether a particular dimension (say 'Year') is the dimension of a cube. Can someone help?



Many thanks.

Regards,
Chris

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 7:22 am
by wang_chris
Then How do I know the total number of dimensions of a cube, which is necessary in the loop?

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 7:26 am
by Alan Kirk
wang_chris wrote:Then How do I know the total number of dimensions of a cube, which is necessary in the loop?
You don't need to know that. You just keep looping until TabDim returns either the dimension you're looking for, or an empty string (which signifies that it's reached the end of the dimension list).

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 7:33 am
by wang_chris
OK, get it, thanks a lot.

BTW, if I add some attributes on dimension '}cube' to manually indicate the existing of those dimensions, is there some potential problem for TM1 system?

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 8:16 am
by declanr
From memory the "}Cubes" and "}Dimensions" dims are completely rebuilt on a server restart based on what it finds in the data directory, as such manual changes end up being lost.

Re: determine whether a particular dimension belongs to a cu

Posted: Fri Jul 04, 2014 9:09 am
by wang_chris
OK, understand.

I have created the loop in process. Thank you for your advice.


Chris

Re: determine whether a particular dimension belongs to a cu

Posted: Sun Jul 06, 2014 10:58 pm
by EvgenyT
There is also a generic IBM process that determines whether dim is unused in the model.

Can be handy for you as well: http://www.ibm.com/developerworks/libra ... s-page632/

Re: determine whether a particular dimension belongs to a cu

Posted: Tue Jul 08, 2014 11:12 am
by wang_chris
Great.

Just curious why IBM don't integrate these good practices into formal function/utility of TM1?


Chris