Page 1 of 1

Hierarchies and element attributes

Posted: Mon Oct 29, 2018 7:34 pm
by PavoGa
It seems another issue has popped up where the hierarchy functionality is long on promise and wee bit short on delivery.

I thought that ElementAttrInsert would generate an attribute that is managed/stored by hierarchy. For instance, say an attribute is created in dimname:hiername1 for Element X, I want the attribute value to be 1, but in dimname:hiername2, I want that value to be 2 for Element X. This functionality seems implied as the function ElementAttrPutN requires a specific hierarchy to be named for each call.

However, that does not seem to be the way it is. For example:

Code: Select all

dimOrg = 'Organization';
hier1 = '2018 East';
hier2 = '2019 East';

ElementAttrPutN(2, dimOrg, hier1, 'Alabama', 'TheRealValue');
ElementAttrPutN(106, dimOrg, hier2, 'Alabama', 'TheRealValue');

results in 106 being the value across both hierarchies. Is there some setting that causes that or is that the way it is supposed to be? Am I over the rainbow here with thinking that functionality is implied because I sure have not read anything explains how this is supposed to work either way.

Re: Hierarchies and element attributes

Posted: Mon Oct 29, 2018 10:14 pm
by paulsimon
Hi

Try HierarchyAttrPutS and see if that works better. I haven't tried it myself though. I am still sticking with the approach of having the same value in all hierarchies for the same element. Having different attributes for the same element in different hierarchies seems to me like it could cause some confusion. However, there may be good business case for it in your application.

Regards

Paul Simon

Re: Hierarchies and element attributes

Posted: Mon Oct 29, 2018 11:31 pm
by lotsaram
Is Alabama a leaf element? Leaves aren't unique and I think the values are actually stored against the Leaves hierarchy in the background to be shared between all hierarchies. Same named C elements however should be able to have different definitions and attribute values between different hierarchies.

Re: Hierarchies and element attributes

Posted: Tue Oct 30, 2018 12:41 pm
by PavoGa
paulsimon wrote: Mon Oct 29, 2018 10:14 pm Hi

Try HierarchyAttrPutS and see if that works better. I haven't tried it myself though. I am still sticking with the approach of having the same value in all hierarchies for the same element. Having different attributes for the same element in different hierarchies seems to me like it could cause some confusion. However, there may be good business case for it in your application.

Regards

Paul Simon
That just handles attributes for the hierarchy itself, not its elements.

Re: Hierarchies and element attributes

Posted: Tue Oct 30, 2018 12:44 pm
by PavoGa
lotsaram wrote: Mon Oct 29, 2018 11:31 pm Is Alabama a leaf element? Leaves aren't unique and I think the values are actually stored against the Leaves hierarchy in the background to be shared between all hierarchies. Same named C elements however should be able to have different definitions and attribute values between different hierarchies.
It is and that, as we now know, is how it works.