Hello,
I have a dimension with multiple levels (5) in it, I would like to count the number of leaf levels in the dimension. I cannot use ELCOMPN because it gives the count of the children and not leafs (i.e. child of child) in other words great grand child count etc.
I tried creating an attribute and putting a formula in the control object but it doesn't work. The formula is ['Lowest_level'](name of the attribute)= IF((ISLEAF=1),1,STET);
Once I can calculate this attribute then maybe I can somehow add it up or something, but this formula is also not populating anything.
Any thoughts on this will be much appreciated.
Count of Leaf
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
-
- 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: Count of Leaf
My first thought is "why do you need to do this"? (Or more precisely, what is the exact objective that you are trying to reach? Hopefully something more than "I just want to know how many leaf elements it has".)tryinghard wrote: I have a dimension with multiple levels (5) in it, I would like to count the number of leaf levels in the dimension. I cannot use ELCOMPN because it gives the count of the children and not leafs (i.e. child of child) in other words great grand child count etc.
I tried creating an attribute and putting a formula in the control object but it doesn't work. The formula is ['Lowest_level'](name of the attribute)= IF((ISLEAF=1),1,STET);
Once I can calculate this attribute then maybe I can somehow add it up or something, but this formula is also not populating anything.
Any thoughts on this will be much appreciated.
My second thought is that unless it's something very obscure, there are probably better ways of achieving it.
"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.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Count of Leaf
Alan,
I have 3 cube A, B & C.
It is for a calculation in C in which I am trying to divide a value in cube A equally in a hierarchy of cube B (which is also in C).
Detals:
The overall objecttive is allocation, In Cube A I have values, in Cube B I have allocation profile and Cube C has final values. Product Hierarchy dimension is not in A but in B & C, I am trying to allocate Values in A to products using a profile in B; however if there is no profile in B then I want that Value in A to distribute equally in the product hierarchy. This is the reason I need to know the leaf level count of the product hierarchy and I would like to keep it dynamic in case products are added or deleted.
I do not want to use TI because users want to see the affect of allocation immediately.
I also am struggling through the feeder also since Cube A does not have Product dimension, so not sure how to feed that.
I have 3 cube A, B & C.
It is for a calculation in C in which I am trying to divide a value in cube A equally in a hierarchy of cube B (which is also in C).
Detals:
The overall objecttive is allocation, In Cube A I have values, in Cube B I have allocation profile and Cube C has final values. Product Hierarchy dimension is not in A but in B & C, I am trying to allocate Values in A to products using a profile in B; however if there is no profile in B then I want that Value in A to distribute equally in the product hierarchy. This is the reason I need to know the leaf level count of the product hierarchy and I would like to keep it dynamic in case products are added or deleted.
I do not want to use TI because users want to see the affect of allocation immediately.
I also am struggling through the feeder also since Cube A does not have Product dimension, so not sure how to feed that.
- mce
- Community Contributor
- Posts: 352
- Joined: Tue Jul 20, 2010 5:01 pm
- OLAP Product: Cognos TM1
- Version: Planning Analytics Local 2.0.x
- Excel Version: 2013 2016
- Location: Istanbul, Turkey
Re: Count of Leaf
I also realized that rules on numeric attributes on control cubes does not work.
Does anyone know why?
Does anyone know why?
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Count of Leaf
Numeric attributes are not really the same as numeric elements. They are actually just numeric formatted strings or strings in disguise. This is the reason you can directly enter a numeric attribute against a consolidated element, and also probably the reason why N: rules do not work in attribute cubes.mce wrote:I also realized that rules on numeric attributes on control cubes does not work.
Does anyone know why?
If you want to have a true numeric attribute that consolidates leaf values and/or can have a numeric leaf rule applied then you need to "roll your own" attribute cube (that is create a 2D lookup cube). You can then rule the values from the 2D lookup cube across to the attribute cube if you want to access the values as attributes.
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Count of Leaf
Thanks for the advice, I also did the same thing eventually... but good to know that formulas do not work on numric attributes.lotsaram wrote:If you want to have a true numeric attribute that consolidates leaf values and/or can have a numeric leaf rule applied then you need to "roll your own" attribute cube (that is create a 2D lookup cube). You can then rule the values from the 2D lookup cube across to the attribute cube if you want to access the values as attributes.mce wrote:I also realized that rules on numeric attributes on control cubes does not work.
Does anyone know why?
-
- MVP
- Posts: 352
- Joined: Wed May 14, 2008 1:37 pm
- OLAP Product: TM1
- Version: 2.5 to PA
- Excel Version: Lots
- Location: Sydney
- Contact:
Re: Count of Leaf
Rules do work on numeric attributes in }ElementAttribute cubes, you just have to pretend that they are strings.
E.g.
As noted previously, they are strings, so won't consolidate, and are probably best suited for flag type data.
E.g.
Code: Select all
['Some Attribute Defined as Numeric'] = S: If( <Some condition>, '1', '0');
Andy Key
-
- Posts: 1
- Joined: Tue May 25, 2010 10:50 pm
- OLAP Product: TM1, ComOps
- Version: 9.5
- Excel Version: 2007
Re: Count of Leaf
I needed to count the number of elements under a heirarchy and achieved the same thing using a separate cube in my local environment.
Create a new TI that creates a new cube using the Tm1 subset - set to your dimension. Choose another dimension to use like "units". The TI reads the dimension and enters a 1 against the element within the data. This runs on the chore that updates the dimension to ensure it is always up-to-date.
You could probably then link this in as another feeder.
Create a new TI that creates a new cube using the Tm1 subset - set to your dimension. Choose another dimension to use like "units". The TI reads the dimension and enters a 1 against the element within the data. This runs on the chore that updates the dimension to ensure it is always up-to-date.
You could probably then link this in as another feeder.