Identify N Level Elements by parent attribute value

Post Reply
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Identify N Level Elements by parent attribute value

Post by vinnusea »

Hi
I have a senario where Users enters attribute value 1 if they need that particular family to bring its N level values to Other Measure.

I have attached picture where it can be understand easyly Picture "Cube1" & "Dim1"

If "L Series 4WD" attribute value is set to 1 then Pull its N Level "Units "--> To --> "New Measure" and so on for all families whos attr value is set to 1.

And the Final Top level must be the aggregation of all Its Lower levels Total....

Please guide me a approach to achieving it..

Thanks..
Attachments
Dimension Hirerchy
Dimension Hirerchy
dim1.JPG (46.2 KiB) Viewed 3235 times
What i want to tell you
What i want to tell you
cube1.JPG (80.56 KiB) Viewed 3235 times
Thanks
Vinnusea
User avatar
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: Identify N Level Elements by parent attribute value

Post by Martin Ryan »

Not 100% sure I understand the problem, but I think this might do the trick for you

Code: Select all

['New Measure'] = N:
if(attrn('Model', elpar('Model', !Model, 1), 'TheAttr')=1, ['Units'], 0);
# If the attribute might be two levels up then this might be necessary instead...
['New Measure'] = N:
if(attrn('Model', elpar('Model', !Model, 1), 'TheAttr')=1 %
attrn('Model', elpar('Model', elpar('Model', !Model, 1), 1), 'TheAttr')=1
, ['Units'], 0);
You won't need to do anything special at the aggregation level.

HTH,
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
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Re: Identify N Level Elements by parent attribute value

Post by vinnusea »

Hi
Your logic is working for me as i tried in Model Dim its good but when am trying to write same logic to my dimension (Pic Attached) is not working ... can you please have a look in that Pic and tell me how many levels do i need to use..

Here "Scrap value" is the attribute am using when it is 1 i need to pull values from "sales Revenue"
attribute value is given 1 at '3 rd level' for "Vitoss"
My Rule is
['Testing_Measure'] = N:
if(
Attrn('OV_Item', !OV_Item, 'Scrap_Value')=1 %

Attrn('OV_Item', elpar('OV_Item',elpar('OV_Item',!OV_Item, 1), 1), 'Scrap_Value')=1 %
Attrn('OV_Item', elpar('OV_Item',elpar('OV_Item',elpar('OV_Item',!OV_Item, 1), 1), 1), 'Scrap_Value')=1


, ['Sales Revenue'], stet);
Attachments
del.JPG
del.JPG (32.88 KiB) Viewed 3170 times
Thanks
Vinnusea
ajain86
Community Contributor
Posts: 132
Joined: Thu Oct 15, 2009 7:45 pm
OLAP Product: TM1
Version: 9.4.1 9.5 9.5.1
Excel Version: 2003 2007

Re: Identify N Level Elements by parent attribute value

Post by ajain86 »

I believe you need 1 more:

[code['Testing_Measure'] = N: if(
Attrn('OV_Item', !OV_Item, 'Scrap_Value')=1 %
Attrn('OV_Item', elpar('OV_Item',elpar('OV_Item',!OV_Item, 1), 1), 'Scrap_Value')=1 %
Attrn('OV_Item', elpar('OV_Item',elpar('OV_Item',elpar('OV_Item',!OV_Item, 1), 1), 1), 'Scrap_Value')=1 %
Attrn('OV_Item', elpar('OV_Item',elpar('OV_Item',elpar('OV_Item',elpar('OV_Item',!OV_Item, 1), 1), 1), 1), 'Scrap_Value')=1
, ['Sales Revenue'], stet);
][/code]
Ankur Jain
Post Reply