Hierarchies and element attributes

Post Reply
User avatar
PavoGa
MVP
Posts: 616
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Hierarchies and element attributes

Post 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.
Ty
Cleveland, TN
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: Hierarchies and element attributes

Post 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
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Hierarchies and element attributes

Post 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.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
PavoGa
MVP
Posts: 616
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: Hierarchies and element attributes

Post 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.
Ty
Cleveland, TN
User avatar
PavoGa
MVP
Posts: 616
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: Hierarchies and element attributes

Post 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.
Ty
Cleveland, TN
Post Reply