Difference of Attribute Functions

Post Reply
User avatar
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:

Difference of Attribute Functions

Post 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.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
lotsaram
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

Post 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.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
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

Post by macsir »

Thanks, lotsaram, for the detailed explanation. I will test them one by one. ;)
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
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

Post 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? :?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
lotsaram
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

Post by lotsaram »

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.
User avatar
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

Post 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. :D
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply