GETATTR

Returns the content of a specified field in an attribute table.

The content is always returned as a string regardless of the type of the attribute. If the attribute is empty, an empty string is returned.

Syntax

GETATTR(DimName, ElemName, ATabID, FieldName)

DimName is the name of the dimension containing the attribute table.

ElemName is the element the attribute is attached to.

ATabID is the 1-based ID of the attribute table containing the attributes.

FieldName is the name of the column in the attribute table containing the attributes.

Example of the GETATTR function with a string-type attribute

If the APRODUCT field for the Car Tires Summer element in attribute table 1 of the Product dimension contains the "Tanja.Saarbruecken@Genesis.com" string, then
GETATTR('Product', 'Car Tires Summer', 1, 'APRODUCT')
returns "Tanja.Saarbruecken@Genesis.com".
The GETATTR function is analogous to an external cube reference in a rule. For example, if you want to write the above rule as a rule for all products, you substitute !Product for 'Car Tires Summer' in the second argument of the function:
GETATTR('Product', !Product, 1, 'APRODUCT')

Examples of the GETATTR function with a numeric-type attribute

To calculate with the content of a numeric attribute, the conversion from string to number is necessary:
NUMBR(GETATTR('PROFIT', 'Revenue', 1, 'OrderPos')) * 5
returns, for example, 45.
You can do equality comparisons without prior conversion:
IF(GETATTR('PROFIT', 'Revenue', 1, 'OrderPos') @= '9', 'Nine', 'Not nine')
returns, for example, 'Nine'.
Note: Comparisons of string values are supported only for equality.

Example of the GETATTR function with a date-type attribute

GETATTR('ValType', 'Actual', 1, 'AFdate1')
returns, for example, '20150429'.

The format is YYYYMMDD.

Example of the GETATTR function with a logical-type attribute

GETATTR('ValType', 'Actual', 1, 'AFlogical1')
returns 'T', 't', 'F', 'f', or an empty string.