Hi
I am guessing that the key aspect of this problem is that you don't know how many levels up the flag might be set, so you can't just use a simple elpar. Therefore you need some recursion to cascade the flag down.
Here is an example in the model dimension of the planning sample. The rule is written in the }ElementAttributes cube. I added two text (String) attributes, one called Flag and one called CascadedFlag
Code: Select all
skipcheck ;
['Total','CascadedFlag']=S: attrs('model',!model,'Flag') ;
['CascadedFlag']=S:
IF( attrs('model',!model,'Flag') @= '1'
,
attrs('model',!model,'Flag')
,
DB('}ElementAttributes_model',elpar('model',!model,1),'CascadedFlag')
) ;
The planning sample isn't a great example since the hierarchy doesn't join up properly but if you look at Total and the T Series or just adapt this to your example it should work OK.
Once you have cascaded the '1' down from the upper level to the base level then you can just write a rule like this in your main cube:
Code: Select all
['Result'] = N:
IF( attrs('model', !model, 'CascadedFlag') @= 1
,
['Value'] * 24
,
['Value']
) ;
Regards
Paul Simon