Page 1 of 1
Difference of Attribute Functions
Posted: Mon May 25, 2020 5:10 am
by macsir
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.
Re: Difference of Attribute Functions
Posted: Mon May 25, 2020 7:39 am
by lotsaram
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.
Re: Difference of Attribute Functions
Posted: Mon May 25, 2020 9:07 pm
by macsir
Thanks, lotsaram, for the detailed explanation. I will test them one by one.

Re: Difference of Attribute Functions
Posted: Tue May 26, 2020 2:22 am
by macsir
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?

Re: Difference of Attribute Functions
Posted: Tue May 26, 2020 1:21 pm
by lotsaram
Caption_Default was used in Cognos Insight (possibly Performance Modler also). This is redundant. It should always be plain "Caption" now.
Re: Difference of Attribute Functions
Posted: Tue May 26, 2020 9:11 pm
by macsir
lotsaram wrote: ↑Tue May 26, 2020 1:21 pm
Caption_Default was used in Cognos Insight (possibly Performance Modler also). This is redundant. It should always be plain "Caption" now.
Thanks, that makes sense.
