TM1 Rule to Propagate Values Between Dimensions

Post Reply
rrizwansayed10
Posts: 9
Joined: Fri Dec 10, 2021 1:41 pm
OLAP Product: TM1, PA, CA, FM
Version: 2.0
Excel Version: 2019

TM1 Rule to Propagate Values Between Dimensions

Post by rrizwansayed10 »

Hello,

I'm seeking assistance with creating a TM1 rule to dynamically propagate values between dimensions in IBM TM1.

There are 2 dim Product & CPG, Half of Product dimension is in CPG.

For eg, Product dimension is,
'Total Company' parent of 'PC' and 'HC', 'PC' splits in 'CPG1' and 'CPG2', 'HC' splits in 'CPG3' and 'CPG4', and 'CPG1' splits in 'LE1' and 'LE2' and 'CPG2' splits in 'LE3' and 'LE4', 'CPG3' splits in 'LE5' and 'LE6', 'CPG4' splits in 'LE7' and 'LE8'.

For eg, CPG dimension is,
'Total Company' parent of 'PC' and 'HC', 'PC' splits in 'CPG1' and 'CPG2', 'HC' splits in 'CPG3' and 'CPG4'.

Objective:
My objective is to create a rule that automatically updates attributes in the Product dimension based on changes made at level 0 elements in the CPG dimension. Specifically, when a value ('Y') is entered at a level 0 element in the CPG dimension, I want this value to be propagated to specific leaf elements in the Product dimension that correspond to that CPG element.
For eg,
If you input 'Y' at the level 0 element 'CPG2' in the CPG dimension, you want this 'Y' value to be propagated to the leaf elements 'LE3' and 'LE4' in the Product dimension, which correspond to 'CPG2'.

Current Approach:
I've attempted to create a rule using the following logic:

['at_PBBU'] = S: If (DB('}ElementAttribute_CPG', !CPG, 'PPBU') @= 'Y', 'Y', ' ');

However, this rule doesn't seem to be achieving the desired outcome.

Request for Assistance:
I'm seeking guidance on how to create a rule that effectively achieves my objective. Additionally, if there's a better approach or alternative solution to accomplish this task, I'm open to suggestions.

Any help or insights would be greatly appreciated!

Thank you.
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TM1 Rule to Propagate Values Between Dimensions

Post by Wim Gielis »

Do you really think people will still want to help, voluntarily, after your first post here ?
viewtopic.php?t=16641
Hijacking a thread, not responding to help given, etc.
Not for me :-)
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
rrizwansayed10
Posts: 9
Joined: Fri Dec 10, 2021 1:41 pm
OLAP Product: TM1, PA, CA, FM
Version: 2.0
Excel Version: 2019

Re: TM1 Rule to Propagate Values Between Dimensions

Post by rrizwansayed10 »

Common man, thanks for your advice on the previous reply, :D :D
That really helped me alot. And I apologies for not replying @WimGielis. :) :)
Now lets discuss this Wim.
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: TM1 Rule to Propagate Values Between Dimensions

Post by MarenC »

Hi,

On first reading this doesn't make sense to me,

I think you say you want to update the product attributes based on the CPG attributes but you appear to be putting the rule in the CPG attribute cube, not the product attribute cube?

I would have expected to see something like this:

['at_PBBU'] = S: If (DB('}ElementAttribute_CPG', !Product, 'PPBU') @= 'Y', 'Y', ' ');

Not that I expect the above code to be the right approach just that I expect the rule to be in the product attribute cube.

Obviously given there are more codes in product than in CPG you will need some way to map the product element to the CPG element.

So the code would be more like:

['at_PBBU'] = S: If (DB('}ElementAttribute_CPG', ATTRS('Product',!Product,'CPG Map Element') 'PPBU') @= 'Y', 'Y', ' ');

The above assumes you Map via a product attribute.

Maren
rrizwansayed10
Posts: 9
Joined: Fri Dec 10, 2021 1:41 pm
OLAP Product: TM1, PA, CA, FM
Version: 2.0
Excel Version: 2019

Re: TM1 Rule to Propagate Values Between Dimensions

Post by rrizwansayed10 »

Hi MarenC,

Thank you so much for your reply, but I tried this, this isnt working.
And I am writing the rule in product attribute cube only.
2 rules I tried:-
1.) ['at_PBBU'] = S: If( (DB('}ElementAttribute_Cpg_hierarchy', ATTRS('Product', !Product ,'at_CPG'), 'att_PPBU') @= 'Y') , 'Y' , '' );

2.) ['at_PBBU'] = S: If( (DB('}ElementAttribute_Cpg_hierarchy', !Product , 'att_PPBU') @= 'Y') , 'Y' , '' );

But both this rule is not working.

Thanks...
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: TM1 Rule to Propagate Values Between Dimensions

Post by MarenC »

Hi,

I think we need more information, one bit of information that would be useful is what do you mean exactly by "But both this rule is not working."?

Also, if you provide a single example of a product that isn't working, i.e. provide its 'at_CPG' attribute value and also the 'att_PPBU' attribute value for this 'at_CPG' element.

Maren
lotsaram
MVP
Posts: 3654
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TM1 Rule to Propagate Values Between Dimensions

Post by lotsaram »

rrizwansayed10 wrote: Tue Mar 26, 2024 11:45 am Hi MarenC,

Thank you so much for your reply, but I tried this, this isnt working.
And I am writing the rule in product attribute cube only.
2 rules I tried:-
1.) ['at_PBBU'] = S: If( (DB('}ElementAttribute_Cpg_hierarchy', ATTRS('Product', !Product ,'at_CPG'), 'att_PPBU') @= 'Y') , 'Y' , '' );

2.) ['at_PBBU'] = S: If( (DB('}ElementAttribute_Cpg_hierarchy', !Product , 'att_PPBU') @= 'Y') , 'Y' , '' );

But both this rule is not working.

Thanks...
Assuming that the elements from the 'Product' dimension also exist in the 'Cpg_hierarchy' and the 'att_PPBU' and 'at_CPG' attributes exist then it is obvious that the rule isn't working because the cube '}ElementAttribute_Cpg_hierarchy' doesn't exist. It should be '}ElementAttributes_Cpg_hierarchy'.

Although it is true that DB to attribute cube is marginally faster than ATTRS, for readibility and simplicity I think it's better to use ATTRS. In this case you would have saved yourself from the typo.

Further suggestions:
- don't mix ATTRS and DB to attribute cube! Go with one or the other (especially in the same line of code)
- attribute naming 'att_PPBU' vs. 'at_CPG'! Is this another typo?
- the slowest thing to evaluate in a rule is a Boolean test (that is an IF). Why not eliminate the IF and just return the 'Y' from the function being evaluated? (and/or presumably the blank or 'N')
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
rrizwansayed10
Posts: 9
Joined: Fri Dec 10, 2021 1:41 pm
OLAP Product: TM1, PA, CA, FM
Version: 2.0
Excel Version: 2019

Re: TM1 Rule to Propagate Values Between Dimensions

Post by rrizwansayed10 »

Thanks all for the reply,

['at_PBBU'] = S: If( (DB('}ElementAttribute_Cpg_hierarchy', ATTRS('Product', !Product ,'at_CPG'), 'att_PPBU') @= 'Y'),
DB('}ElementAttribute_Cpg_hierarchy', ATTRS('Product', !Product ,'at_CPG'), 'att_PPBU'),
' ' );

This rule is working now.

I wanted to put Y flag in the product hierarchy only if cpg hierarchy has Y flag.
Post Reply