Page 1 of 1

Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 12:32 pm
by Firefly007
Hi All,


I am trying to display same value as parent in attribute cube of a dimension. Currently i can display for all children using the below rule.

['Flag'] =S: IF(ELLEV('TEXT',!Text)=0,'Current',Continue);

What i am trying to do is to display only when consolidation is not blank .If I have multiple individual unique hierarchy's Can we do it dynamically?


Regards,

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 12:51 pm
by Wim Gielis
Hello,

Why don't you update the }ElementAttributes_Text cube with Turbo Integrator ?
Can the dimension structures be changed by users ?

Can a lowest-level element in the dimension Text have multiple (immediate) parents ?

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 2:01 pm
by jim wood
Try:

Code: Select all

['Flag'] = S: IF(Ellev('Text',!Text)=0
                     ,IF(DB('}ElementAttributes_Text',ElPar('Text',!Text,1),'Flag')@<>''
                          ,DB('}ElementAttributes_Text',ElPar('Text',!Text,1),'Flag')
                          ,STET
                         )
                     ,STET
                    );
This assumes that each child only has one parent or will assume the value of the first parent. You can always check the number of parents if you want this to differ.

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 2:02 pm
by jim wood
Wim Gielis wrote:Hello,

Why don't you update the }ElementAttributes_Text cube with Turbo Integrator ?
Can the dimension structures be changed by users ?

Can a lowest-level element in the dimension Text have multiple (immediate) parents ?
Not sure why you'd do this with TI. It would mean every time the attribute changes you'd need to run it. For one text attribute this seems over kill when a simple rule will do it.

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 3:33 pm
by Firefly007
Thank you Jim,

This approach helps me to calculate further rules in a different cube.I agree TI process would be long process to make other depended rules get calculated.

-Regards

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 3:35 pm
by Wim Gielis
jim wood wrote:
Wim Gielis wrote:Hello,

Why don't you update the }ElementAttributes_Text cube with Turbo Integrator ?
Can the dimension structures be changed by users ?

Can a lowest-level element in the dimension Text have multiple (immediate) parents ?
Not sure why you'd do this with TI. It would mean every time the attribute changes you'd need to run it. For one text attribute this seems over kill when a simple rule will do it.
You're right, a simple rule will do.
In case there would be multiple parents, we might think of using TI to store the parent in a text attribute,
and then picking up that parent name in a rule like yours.

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Tue Feb 09, 2016 3:43 pm
by tomok
jim wood wrote:Not sure why you'd do this with TI.
Because you might not get the value you want in the attribute if you have multiple hierarchies in the dimension , which the OP said he had. You have to hard code a parent number in the rule so it would be imperative that you maintain STRICT control over the dimension. The best way to control it would be to make the tree we are talking about be the first tree in the dimension and ALL elements need to be in that tree. This would ensure that parent number 1 for each of the elements would be the parent you need the attribute value for. If you can't do this, for whatever reason, the best approach would be a TI since with a TI you could walk your way through a tree and set the values accordingly, without worrying about which parent number an element has.

Re: Trying to display same value as parent in attribute cube of a dimension

Posted: Wed Feb 10, 2016 2:27 pm
by jim wood
tomok wrote:
jim wood wrote:Not sure why you'd do this with TI.
Because you might not get the value you want in the attribute if you have multiple hierarchies in the dimension , which the OP said he had. You have to hard code a parent number in the rule so it would be imperative that you maintain STRICT control over the dimension. The best way to control it would be to make the tree we are talking about be the first tree in the dimension and ALL elements need to be in that tree. This would ensure that parent number 1 for each of the elements would be the parent you need the attribute value for. If you can't do this, for whatever reason, the best approach would be a TI since with a TI you could walk your way through a tree and set the values accordingly, without worrying about which parent number an element has.
That's why I mentioned the number of parents. If you expand it with a couple of IF statements you can spool through the number of parents. Granted a WHILE in TI is neater from a pure coding point of view, and that you'd be limited within the rule to hard stop number of parents, it would still be dynamic and not restricted in the same way as TI. As every parent needs a value, no feeder is required, so even if you put 10 if statements in there the overhead would minimal.