Identify in Rule if dim is part of a cube
-
- Regular Participant
- Posts: 197
- Joined: Thu Dec 03, 2009 8:47 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2.x
- Excel Version: 2010
- Location: Singapore
Identify in Rule if dim is part of a cube
Guys,
Is it possible to identify via Rules if a dimension is part of a cube?
Thanks.
Art
Is it possible to identify via Rules if a dimension is part of a cube?
Thanks.
Art
-
- MVP
- Posts: 1816
- 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: Identify in Rule if dim is part of a cube
Presuming that you don't create cubes that often you could just create a 2d cube using }Dimensions and }cubes then have a 1 or 0 to determine if the dim exists in the cube.
You can even automate the population of 1s and 0s via TI using the tabdim function and a loop.
You can even automate the population of 1s and 0s via TI using the tabdim function and a loop.
Declan Rodger
-
- Regular Participant
- Posts: 197
- Joined: Thu Dec 03, 2009 8:47 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2.x
- Excel Version: 2010
- Location: Singapore
Re: Identify in Rule if dim is part of a cube
That's a solution. Just wondering because in my case, we already have plenty of cubes. If this is not possible thru' rules alone and without creating a look-up cube, then creating this 2d cube is the only solution.
-
- MVP
- Posts: 3667
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Identify in Rule if dim is part of a cube
The function you want is TABDIM. If it returns 0 then the dimension is not part of the cube.
When building a helper cube for this type of lookup I believe it is best to have a replica of the }dimensions and }cubes dims with an ALL rollup. That way analysis of dimensions not used by any cubes also becomes very easy.
When building a helper cube for this type of lookup I believe it is best to have a replica of the }dimensions and }cubes dims with an ALL rollup. That way analysis of dimensions not used by any cubes also becomes very easy.
-
- Regular Participant
- Posts: 197
- Joined: Thu Dec 03, 2009 8:47 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2.x
- Excel Version: 2010
- Location: Singapore
Re: Identify in Rule if dim is part of a cube
Many thanks for the help.
- FallenCipher
- Posts: 8
- Joined: Mon Aug 13, 2012 8:17 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2
- Excel Version: 2013
- Location: Germany
Re: Identify in Rule if dim is part of a cube
TABDIM only gives you the dimension name for the specified index. TABDIM doesn't accept a dimension name as a parameter.lotsaram wrote:The function you want is TABDIM. If it returns 0 then the dimension is not part of the cube.
A small helper cube would be the best solution in my opinion.
"Who's the more foolish? The fool, or the fool who follows him?"
- Obi-Wan Kenobi, Star Wars Episode IV
- Obi-Wan Kenobi, Star Wars Episode IV
-
- MVP
- Posts: 1816
- 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: Identify in Rule if dim is part of a cube
Which can purely be built via a scheduled TI and a pretty damn simple TI at that so all in all its not at all difficult to do...FallenCipher wrote:TABDIM only gives you the dimension name for the specified index. TABDIM doesn't accept a dimension name as a parameter.lotsaram wrote:The function you want is TABDIM. If it returns 0 then the dimension is not part of the cube.
A small helper cube would be the best solution in my opinion.
But why do you need to know whether a Dim is part of a Cube in a rule statement?
Declan Rodger
-
- Regular Participant
- Posts: 197
- Joined: Thu Dec 03, 2009 8:47 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2.x
- Excel Version: 2010
- Location: Singapore
Re: Identify in Rule if dim is part of a cube
It just became a requirement to identify if certain dims are part of certain cubes. And I wanted to make it general and simpler via rules.
But then, based on comments, it's the only solution which is as you said very simple to do.
Thanks.
But then, based on comments, it's the only solution which is as you said very simple to do.
Thanks.
-
- MVP
- Posts: 1816
- 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: Identify in Rule if dim is part of a cube
bunchukokoy wrote:It just became a requirement to identify if certain dims are part of certain cubes. And I wanted to make it general and simpler via rules.
But then, based on comments, it's the only solution which is as you said very simple to do.
Thanks.
From what I recall there was a TI knocking about (possibly on Bedrock) that exported a csv telling you which dimensions weren't in any cubes... a little tweak to that may give you what you need.
Declan Rodger
-
- MVP
- Posts: 3667
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Identify in Rule if dim is part of a cube
Sorry what I meant was returns blank if the dimension is not part of the cube, not 0.FallenCipher wrote:TABDIM only gives you the dimension name for the specified index. TABDIM doesn't accept a dimension name as a parameter.lotsaram wrote:The function you want is TABDIM. If it returns 0 then the dimension is not part of the cube.
A small helper cube would be the best solution in my opinion.
I don't know what your fuss is about. This is very easy to do:
For example a 4 dim cube called Dim_Use; zCubes, zDimensions, DimIndex, Dim_Use_M (where zCubes and zDimensions are replicas of the control dims but with an ALL rollup). The "index" dimension just has elements 1,2,3 .... to a sensible max equal to ro greater then the maximum number of dimensions in any cube in the model. The measure dimension need only have one numeric element "position" or "index" (but you can easily add a 2nd numeric or string element "used in cube" with a 1/0 or true/false value if the value of position is non-zero)
Code: Select all
['Dim_Use_M':'Position'] = N:
IF( TABDIM(!zCubes, NUMBR(!DimIndex)) @= !zDimensions,
NUMBR(!DimIndex),
0
);
If for "ALL Cubes" the position value is 0 then the dimension is not used in any cubes.
Simple.
-
- Regular Participant
- Posts: 197
- Joined: Thu Dec 03, 2009 8:47 am
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2.x
- Excel Version: 2010
- Location: Singapore
Re: Identify in Rule if dim is part of a cube
Thanks for the help guys.