Hi, I am playing with all sorts of different attribute functions and I am lost. Could anyone share what you have found? Thanks.
ATTRPUTS vs ELEMENTATTRPUTS ???
ATTRPUTS vs HIERARCHYATTRPUTS ???
ELEMENTATTRPUTS vs HIERARCHYATTRPUTS ???
It is so confusing as ATTRPUTS can use "dim:hier" format to specify a hierarchy.
Difference of Attribute Functions
-
- MVP
- Posts: 3703
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Difference of Attribute Functions
ElementAttrPut is exactly the same as AttrPut except that it allows to send attribute values to C elements of different hierarchies. (You can't have different attribute values for leaf elements in different hierarchies, leaf elements are always shared. If you try updating a leaf attribute value against a specific hierarchy you will find the updated value against all hierachies where the element is present.) There is no real need for ElementAttrPut since is is nothing more than a routing to the AttrPut function. That is:
ElementAttrPutS(sValue, 'DimName', 'HierName', 'ElName', 'AttrName', [LangLocaleCode] );
is literally just a shortcut to
AttrPutS(sValue, 'DimName:HierName', 'ElName', 'AttrName', [LangLocaleCode] );
HierarchyAttrPut is to DimensionAttrPut what ElementAttrPut is to AttrPut. This function has nothing to do with attributes for elements, rather it will write a value (like a display caption) to the }DimensionAttributes cube. You could equally well use:
DimensionAttrPutS(sValue, 'DimensionName:HierName', 'Caption', [LangLocaleCode] );
For that matter there is also SubsetAttrInsert and HierarchySubsetAttrInsert which create a }SubsetAttributes_DimName cube to allow a Caption (or other custom attributes) to be created. The same principle follows; you can just address the DimName:HierName as the dimension argument.
Note that for all of the above there is no function which creates the }Localized cube for alternate language values of the attributes. The }Localized cube is in all cases automatically created simply by using the AttrPut function and addressing a valid locale from the }Cultures dimension in the optional LangLocaleCode argument.
ElementAttrPutS(sValue, 'DimName', 'HierName', 'ElName', 'AttrName', [LangLocaleCode] );
is literally just a shortcut to
AttrPutS(sValue, 'DimName:HierName', 'ElName', 'AttrName', [LangLocaleCode] );
HierarchyAttrPut is to DimensionAttrPut what ElementAttrPut is to AttrPut. This function has nothing to do with attributes for elements, rather it will write a value (like a display caption) to the }DimensionAttributes cube. You could equally well use:
DimensionAttrPutS(sValue, 'DimensionName:HierName', 'Caption', [LangLocaleCode] );
For that matter there is also SubsetAttrInsert and HierarchySubsetAttrInsert which create a }SubsetAttributes_DimName cube to allow a Caption (or other custom attributes) to be created. The same principle follows; you can just address the DimName:HierName as the dimension argument.
Note that for all of the above there is no function which creates the }Localized cube for alternate language values of the attributes. The }Localized cube is in all cases automatically created simply by using the AttrPut function and addressing a valid locale from the }Cultures dimension in the optional LangLocaleCode argument.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
- macsir
- MVP
- Posts: 785
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Difference of Attribute Functions
Thanks, lotsaram, for the detailed explanation. I will test them one by one. 

- macsir
- MVP
- Posts: 785
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Difference of Attribute Functions
One more question here. It look like "Caption" attribute can change the display name in PAW. But "Caption_Default" doesn't seem to be working in any aspect? 

-
- MVP
- Posts: 3703
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Difference of Attribute Functions
Caption_Default was used in Cognos Insight (possibly Performance Modler also). This is redundant. It should always be plain "Caption" now.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
- macsir
- MVP
- Posts: 785
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Difference of Attribute Functions
Thanks, that makes sense.
