Rule for Leaf of an item
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Rule for Leaf of an item
Hello,
I am trying to apply a rule only to the Leaf of a particlaur item in the hierarchy. The cube has 6 dimensions and one dimension has 6 levels.
Eg.if this is the hierarchy I would like to apply the formula to Leaf of A1 i.e. A11, A121, A122, A13 and A14
Thanks...
A
-A1
--A11
--A12
---A121
---A122
--A13
--A14
-A2
B
C
I am trying to apply a rule only to the Leaf of a particlaur item in the hierarchy. The cube has 6 dimensions and one dimension has 6 levels.
Eg.if this is the hierarchy I would like to apply the formula to Leaf of A1 i.e. A11, A121, A122, A13 and A14
Thanks...
A
-A1
--A11
--A12
---A121
---A122
--A13
--A14
-A2
B
C
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: Rule for Leaf of an item
At least three ways occur to me:
a put n: on the right hand side of the rule eg
['Value'] = n: ['Cost'] * ['Price'];
b Test the level of the element - 0 is the lowest
['X'] = if(ellev('Product',!Product) = 0, ['Y'],
#else
stet);
c Use ISLEAF
Using n: is the best approach, indeed I would assert that this should be on the vast majority of rule lines. Use <blank> for 'KPI' rules eg
['Gross Profit %'] = ['Gross Profit'] \ ['Revenue'];
and c: only rules are generally bad news as they interfere with the consolidation logic. (NB I said _generally_.)
Use ellev if you need to apply the rule to parents in other dimensions, but to base levels in this one.
I don't think I've worked out whether ISLEAF is useful, but it's there for completeness.
HTH
a put n: on the right hand side of the rule eg
['Value'] = n: ['Cost'] * ['Price'];
b Test the level of the element - 0 is the lowest
['X'] = if(ellev('Product',!Product) = 0, ['Y'],
#else
stet);
c Use ISLEAF
Using n: is the best approach, indeed I would assert that this should be on the vast majority of rule lines. Use <blank> for 'KPI' rules eg
['Gross Profit %'] = ['Gross Profit'] \ ['Revenue'];
and c: only rules are generally bad news as they interfere with the consolidation logic. (NB I said _generally_.)
Use ellev if you need to apply the rule to parents in other dimensions, but to base levels in this one.
I don't think I've worked out whether ISLEAF is useful, but it's there for completeness.
HTH
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: Rule for Leaf of an item
You will have to use the ELLEV() function within your rule.
So your rule will look something like this:
[Area]=IF(ELLEV('Dimension',!Element)=0,'True', 'False');
You can also use N: in your rule. Depends upon what you are trying to achieve.
So your rule will look something like this:
[Area]=IF(ELLEV('Dimension',!Element)=0,'True', 'False');
You can also use N: in your rule. Depends upon what you are trying to achieve.
Cheers!
Rizwan Kaif
Rizwan Kaif
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Rule for Leaf of an item
Thanks for the input.
The formula has to apply to a specific item in the hierarchy, so it has to apply to Leafs of A1, but Not the leafs of A2 or B or C, Just leafs of A1.
The formula has to apply to a specific item in the hierarchy, so it has to apply to Leafs of A1, but Not the leafs of A2 or B or C, Just leafs of A1.
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: Rule for Leaf of an item
Do you have access to the RTMF?
You can use ELISANC() function in your rule
[Area]=IF((ELLEV('Product',!Product)=0) & ELISANC('Product', 'A1', !Product)=1),'True', 'False');
Hope this helps!
You can use ELISANC() function in your rule
[Area]=IF((ELLEV('Product',!Product)=0) & ELISANC('Product', 'A1', !Product)=1),'True', 'False');
Hope this helps!
Cheers!
Rizwan Kaif
Rizwan Kaif
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Rule for Leaf of an item
Thanks Kaif, it worked, but instead of ELLEV I just used N:, do you think its ok.
What is RTMF?
What is RTMF?
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: Rule for Leaf of an item
Yes that should be fine. You can use N: instead of using ELLEV() - but depends what you are trying to do. But I assume in your case it should be fine.
RTFM is referred to the Manual. Please dont ask me what RTFM stands for
RTFM is referred to the Manual. Please dont ask me what RTFM stands for

Cheers!
Rizwan Kaif
Rizwan Kaif
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Rule for Leaf of an item
Kaif, which Manual is RTFM, I don't think I have it, can you please attach it with this thread?
Thanks
Thanks
- Martin Ryan
- Site Admin
- Posts: 2003
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: Rule for Leaf of an item
RTFM is an acronym that suggests that you will find what you are looking for in the manual. It is not name of the manual itself.
Martin
Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
-
- Posts: 60
- Joined: Wed Aug 04, 2010 3:59 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Rule for Leaf of an item
Darn, a simple Google search told me what it is.. Read the ****** Manual... 

- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: Rule for Leaf of an item
Wow...that is so funny.tryinghard wrote:Kaif, which Manual is RTFM, I don't think I have it


Cheers!
Rizwan Kaif
Rizwan Kaif