Topic
  • 3 replies
  • Latest Post - ‏2013-01-16T07:42:24Z by SystemAdmin
SystemAdmin
SystemAdmin
658 Posts

Pinned topic Attrs function

‏2013-01-15T14:00:45Z |
The TM1 reference guide explains that ATTRS function returns the string value of currency attribute
"ATTRS('plan_business_unit', '10100', 'Currency')
In this example, the function returns the string value of the Currency attribute of the 10100 element
in the plan_business_unit dimension".

is this means this function pickup the string value stored in that cell?I am not able to get it right.Could some one explain with an example ,please.Thanks
Updated on 2013-01-16T07:42:24Z at 2013-01-16T07:42:24Z by SystemAdmin
  • Rizwan.Kaif
    Rizwan.Kaif
    197 Posts

    Re: Attrs function

    ‏2013-01-15T16:13:51Z  
    This means that the ATTRS function will go and have a look at the Attributes of the Plan_Business_Unit dimension and will grab the value of the Currency attribute of element 10100. See attachment for details.

    In this example, Currency is a Test/String type attribute, that is why we are using the ATTRS() function. If the Attribute would have been a Numeric type in that case we would have to use the ATTRN() function.

    Cheers!
    Rizwan Kaif
  • RobertTanenbaum
    RobertTanenbaum
    14 Posts

    Re: Attrs function

    ‏2013-01-15T19:08:42Z  
    When we refer to the value of a cell, that refers to the value of a cell in a cube.

    Attributes are not related to any cube. Attributes are related to a dimension.

    For example, let's say you are tracking sales by product and period and location so those three dimensions make up the sales cube. The value in the cell in the cube is the amount of sales for a specific product, period and location. But each element in the product dimension might have certain attributes which are not part of the sales cube but are related to the product independently. For example each product might have a name, a manufacturer and a SKU. Those would be attributes on the product dimension and you would use the attrs or attrn functions to access those attributes. If one of your products was "hammer" you would find its SKU by calling attrs('product','hammer','SKU')
  • SystemAdmin
    SystemAdmin
    658 Posts

    Re: Attrs function

    ‏2013-01-16T07:42:24Z  
    This means that the ATTRS function will go and have a look at the Attributes of the Plan_Business_Unit dimension and will grab the value of the Currency attribute of element 10100. See attachment for details.

    In this example, Currency is a Test/String type attribute, that is why we are using the ATTRS() function. If the Attribute would have been a Numeric type in that case we would have to use the ATTRN() function.

    Cheers!
    Rizwan Kaif
    Thanks Rizwan and Robert,Appreciate your clear answers.I wish IBM reference guide could have been this clear! Thanks a lot again.