Page 1 of 1

Rule for Leaf of an item

Posted: Wed Aug 11, 2010 7:59 pm
by tryinghard
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

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 8:23 pm
by David Usherwood
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

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 8:27 pm
by rkaif
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.

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 8:53 pm
by tryinghard
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.

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 10:27 pm
by rkaif
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!

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 10:48 pm
by tryinghard
Thanks Kaif, it worked, but instead of ELLEV I just used N:, do you think its ok.

What is RTMF?

Re: Rule for Leaf of an item

Posted: Wed Aug 11, 2010 11:08 pm
by rkaif
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 :lol:

Re: Rule for Leaf of an item

Posted: Thu Aug 12, 2010 12:42 am
by tryinghard
Kaif, which Manual is RTFM, I don't think I have it, can you please attach it with this thread?

Thanks

Re: Rule for Leaf of an item

Posted: Thu Aug 12, 2010 12:52 am
by Martin Ryan
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

Re: Rule for Leaf of an item

Posted: Thu Aug 12, 2010 2:27 am
by tryinghard
Darn, a simple Google search told me what it is.. Read the ****** Manual... :twisted:

Re: Rule for Leaf of an item

Posted: Thu Aug 12, 2010 5:06 am
by rkaif
tryinghard wrote:Kaif, which Manual is RTFM, I don't think I have it
Wow...that is so funny. :lol: According to the experts all the Manuals are RTFM and every one have got them :lol: