determine whether a particular dimension belongs to a cube

Post Reply
wang_chris
Posts: 122
Joined: Thu Jan 31, 2013 1:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2007

determine whether a particular dimension belongs to a cube

Post 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
hyunjia
Posts: 64
Joined: Fri Jul 27, 2012 4:13 pm
OLAP Product: TM1
Version: 2010
Excel Version: Excel 2010

Re: determine whether a particular dimension belongs to a cu

Post 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
wang_chris
Posts: 122
Joined: Thu Jan 31, 2013 1:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2007

Re: determine whether a particular dimension belongs to a cu

Post by wang_chris »

Then How do I know the total number of dimensions of a cube, which is necessary in the loop?
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: determine whether a particular dimension belongs to a cu

Post 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).
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
wang_chris
Posts: 122
Joined: Thu Jan 31, 2013 1:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2007

Re: determine whether a particular dimension belongs to a cu

Post 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?
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: determine whether a particular dimension belongs to a cu

Post 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.
Declan Rodger
wang_chris
Posts: 122
Joined: Thu Jan 31, 2013 1:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2007

Re: determine whether a particular dimension belongs to a cu

Post by wang_chris »

OK, understand.

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


Chris
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: determine whether a particular dimension belongs to a cu

Post 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/
wang_chris
Posts: 122
Joined: Thu Jan 31, 2013 1:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2007

Re: determine whether a particular dimension belongs to a cu

Post by wang_chris »

Great.

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


Chris
Post Reply