Hierarchy Attribute Functions
- PavoGa
- MVP
- Posts: 617
- 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
Hierarchy Attribute Functions
The Reference Guide contains the functions HierarchyAttrPutS, HierarchyAttrPutN, HierarchyATTRS and HierarchyATTRN. There are separate functions for manipulating attributes for Hierarchy Subsets. However, there does not seem to be corresponding functions like HierarchyAttrInsert and HierarchyAttrDelete.
I've tried using the DimensionAttrInsert with the 'DimName':'HierName' form, but it will not even compile. I searched, but nothing comes up about how to create a hierarchy attribute that the functions listed above can interact with.
So...how does one go about creating a hierarchy attribute that the HierarchyATTR... functions can be used against?
I've tried using the DimensionAttrInsert with the 'DimName':'HierName' form, but it will not even compile. I searched, but nothing comes up about how to create a hierarchy attribute that the functions listed above can interact with.
So...how does one go about creating a hierarchy attribute that the HierarchyATTR... functions can be used against?
Ty
Cleveland, TN
Cleveland, TN
- PavoGa
- MVP
- Posts: 617
- 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: Hierarchy Attribute Functions
Nevermind. Seems that AttrInsert works:
ATTR('dimname:hierarchyname', '', 'newattribute, 'A');
ATTR('dimname:hierarchyname', '', 'newattribute, 'A');
Ty
Cleveland, TN
Cleveland, TN
-
- Posts: 20
- Joined: Wed Feb 23, 2011 6:43 pm
- OLAP Product: TM1
- Version: Latest
- Excel Version: 2013
Re: Hierarchy Attribute Functions
Attributes are not specific to hierarchies, but exist for the dimension and all hierarchies associated with that dimension.
- PavoGa
- MVP
- Posts: 617
- 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: Hierarchy Attribute Functions
While the ATTR('dimname:hierarchyname', ...) syntax compiled and ran, it did not seem to accomplish anything.
Here is what I'm wanting to do: we will have hierarchies that vary by version. We want to identify or name the hierarchy with a key and then use an alias for display purposes. Seems that we should be able to do that.
Thanks, ndivine, for that. That seems to be what the documentation hinted at, but not quite able to get it to work.
Here is what I'm wanting to do: we will have hierarchies that vary by version. We want to identify or name the hierarchy with a key and then use an alias for display purposes. Seems that we should be able to do that.
Thanks, ndivine, for that. That seems to be what the documentation hinted at, but not quite able to get it to work.
Ty
Cleveland, TN
Cleveland, TN
-
- Posts: 20
- Joined: Wed Feb 23, 2011 6:43 pm
- OLAP Product: TM1
- Version: Latest
- Excel Version: 2013
Re: Hierarchy Attribute Functions
AttrInsert adds an attribute to the dimension. Then, you would need to populate that attribute with a value for an element using AttrPutS or HierarchyAttrPutS. . Then, you could pull that attribute value using ATTRS or HierarchyATTRS.
But, it sounds like you are actually trying to set up an alias for the hierarchy name itself, which would involve creating attributes on a control dimension, like '}Hierarchies_DimName'. While possible, I don't know that it gets you much as that alias only exists on the }Hierarchies_DimName dimension which is not a dimension you will be using (generally).
But, it sounds like you are actually trying to set up an alias for the hierarchy name itself, which would involve creating attributes on a control dimension, like '}Hierarchies_DimName'. While possible, I don't know that it gets you much as that alias only exists on the }Hierarchies_DimName dimension which is not a dimension you will be using (generally).
-
- Posts: 20
- Joined: Wed Feb 23, 2011 6:43 pm
- OLAP Product: TM1
- Version: Latest
- Excel Version: 2013
Re: Hierarchy Attribute Functions
To further clarify, you would add attributes to a dimension so that you can store attribute information about the elements within that dimension. To store attribute information about hierarchy names, you don't add attributes to dimension:hierarchy, you have to add them to the dimension that has dimension:hierarchy elements within it, which is }Hierarchies_DimName.
- PavoGa
- MVP
- Posts: 617
- 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: Hierarchy Attribute Functions
Actually, there are a whole host of functions that seem to indicate that attributes can be added to Hierarchies and Hierarchy elements separate from the dimension attributes. I'm using PA2.0ndivine wrote: ↑Mon Sep 10, 2018 8:59 pm To further clarify, you would add attributes to a dimension so that you can store attribute information about the elements within that dimension. To store attribute information about hierarchy names, you don't add attributes to dimension:hierarchy, you have to add them to the dimension that has dimension:hierarchy elements within it, which is }Hierarchies_DimName.
I was able to add an alias, "AltName" to the Dimensions dimension
Code: Select all
DimensionAttrInsert('', 'AltName', 'A');
Code: Select all
HierarchyAttrPutS('The Crazy Hierarchy', 'Accounts Master', 'Statistical Categories', 'AltName');
Ty
Cleveland, TN
Cleveland, TN
- PavoGa
- MVP
- Posts: 617
- 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: Hierarchy Attribute Functions
Okay, got what I wanted by using "Caption" as the alias attribute. Wish this was a little more flexible, but can make this work.
Ty
Cleveland, TN
Cleveland, TN
-
- MVP
- Posts: 3652
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Hierarchy Attribute Functions
The Caption attribute doesn't have to be an alias, it can also be a text attribute. (But is does have to be called "Caption".)
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- MVP
- Posts: 3652
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Hierarchy Attribute Functions
Don't do this ! It would be fairly non-productivendivine wrote: ↑Mon Sep 10, 2018 8:59 pm To further clarify, you would add attributes to a dimension so that you can store attribute information about the elements within that dimension. To store attribute information about hierarchy names, you don't add attributes to dimension:hierarchy, you have to add them to the dimension that has dimension:hierarchy elements within it, which is }Hierarchies_DimName.
The dimensions }subsets_dimName, }hierarchies_dimName & }views_cubeName are all destroyed during server shutdown phase and don't exist in the at rest copy of the instance. These dimensions get rebuilt from scratch during server startup from analysis of the data directory contents just like the }dimensions and }cubes dimensions. So any attributes added here will exist only for the current session.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
- PavoGa
- MVP
- Posts: 617
- 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: Hierarchy Attribute Functions
Chose to go with alias as the alias can be passed as an argument, while a text attribute cannot. Although, I did find some of the online documentation for IBM actually contradicted itself on this point.
Ty
Cleveland, TN
Cleveland, TN
-
- Posts: 20
- Joined: Wed Feb 23, 2011 6:43 pm
- OLAP Product: TM1
- Version: Latest
- Excel Version: 2013
Re: Hierarchy Attribute Functions
Good to know.lotsaram wrote: ↑Tue Sep 11, 2018 7:36 amDon't do this ! It would be fairly non-productivendivine wrote: ↑Mon Sep 10, 2018 8:59 pm To further clarify, you would add attributes to a dimension so that you can store attribute information about the elements within that dimension. To store attribute information about hierarchy names, you don't add attributes to dimension:hierarchy, you have to add them to the dimension that has dimension:hierarchy elements within it, which is }Hierarchies_DimName.
The dimensions }subsets_dimName, }hierarchies_dimName & }views_cubeName are all destroyed during server shutdown phase and don't exist in the at rest copy of the instance. These dimensions get rebuilt from scratch during server startup from analysis of the data directory contents just like the }dimensions and }cubes dimensions. So any attributes added here will exist only for the current session.
To clarify on the }Dimensions dimension, attributes here will persist session to session. I have several models that use attributes here. And to add to the confusion, there are two ways to do dimension attributes: 1. }DimensionAttributes, accessed by right-clicking on Dimensions>Edit Attributes (in Server Explorer) and 2. }ElementAttributes_}Dimensions which is created by Editing Element Attributes on the }Dimensions dimension.