MicroStrategy ONE

Attribute Form Expressions

Attribute forms are identifiers or descriptors of an attribute, such as ID, Name, and Address. These units are part of an attribute, for example, Customer. Attribute forms are defined by at least one expression, and these expressions act on column data and can contain functions. The types of attribute form expressions are as follows:

  • Simple
  • Implicit
  • Derived
  • Heterogeneous

For more information on these types of attribute forms, see the Advanced Reporting Help.

In the context of MicroStrategy functions, this book discusses derived expressions. A derived expression can only use single-value functions, and arguments that are used in the expression are columns. See the examples described below.

Example 1: Subtraction ( - )

(Year(CurrentDate()) - Year([HIRE_DATE]))

The attribute form Employee Experience is defined by the above expression using the simple mathematical operator, subtraction.

This example can be found in the MicroStrategy Tutorial project in the following folder: MicroStrategy Tutorial/Schema Objects/Attributes/Geography.

Example 2: InitCap

InitCap([CUST_LAST_NAME])

Text data is typically in all upper-case or all lower-case letters. This example shows that for the attribute form of customer's last name, you can use the single-value function, InitCap, to make the first letter capitalized and all other letters in lower case.

Example 3: ApplySimple

ApplySimple("Datediff(YY,#0,getdate())", [BIRTH_DATE])

The attribute form, Age, can be defined by using the single-value function, ApplySimple.

  • For all Apply functions, do not use a group for the attribute form expression. Use a single form because form groups are ignored by the Analytical Engine. For example, you cannot use Customer@Name, where Name is a form group defined as the customer's first name, middle name, and last name.
  • The syntax of apply functions is database-specific. For more information, see Internal Functions.

To Access Attribute Form Expressions

For a New Attribute

  1. From the MicroStrategy Developer File menu, point to New > Attribute. The Attribute Editor opens three dialog boxes, if the cascading dialog box option is enabled in the Developer Preference (as it is by default). The three dialog boxes are New Attribute, Create New Attribute Form, and Create New Attribute Form Expression. The Create New Attribute Form Expression dialog box is where functions and operators are used.
  2. Build your expression by using the functions in one of the following ways:
    • Click (Insert Function) in the Definition pane. The Insert Function wizard opens.
    • Enter the function name and all required expression syntax directly in the Enter your formula here box.

For an Existing Attribute

  1. To access the editor, select the attribute in the folder list, object browser, or report view and right-click and select Edit.
  2. Select an attribute form and click Modify. The Modify Attribute Form dialog box displays.

    To add a new form to the existing Attribute, click New. This automatically opens the New Attribute Form Expression dialog box.

  3. Select the expression you want to edit and click Modify.

    To add a new expression to the existing form, click New. This automatically opens the New Attribute Form Expression dialog box.

  4. The Modify Attribute Form Expression dialog displays with the selected expression loaded.
  5. Create or edit the expression, accessing the functions in one of the following ways:
    • Click (Insert Function) in the Definition pane. The Insert Function wizard opens.
    • Enter/edit the function name and all required expression syntax in the Enter your formula here box.