Previous section   Next section

%LABEL

Given an MDX expression, returns the same expression with a different label for use as a row or column header. %LABEL can also specify formatting for the row or column. This function is a Business Intelligence extension to MDX.

Returned Type

This function returns an expression of the same type that you use with the function.

Syntax and Details

%LABEL(MDX_expression,label,format_string,solve_order,cell_style,heading_style)
Where:
  • MDX_expression is an MDX expression of any type.
  • label is a string to use as the new label as a row or column header.
  • format_string is an optional literal (such as "#.##") that specifies how to display the values. See FORMAT_STRING Clause.
  • solve_order is an optional integer that specifies the order in which to apply labels. See SOLVE_ORDER Clause.
  • cell_style is an optional literal that specifies a Cascading Style Sheet (CSS) style definition to apply to the data cells.
  • heading_style is an optional literal that specifies a Cascading Style Sheet (CSS) style definition to apply to the heading.

Example

SELECT %LABEL(MEASURES.[avg allergy count],"my label") ON 0, colord.MEMBERS ON 1 FROM patients

                                  my label
1 None                                 1.04
2 Blue                                 1.01
3 Green                                1.02
4 Orange                               1.01
5 Purple                              1.06
6 Red                                  1.03
7 Yellow                               1.00
In contrast:
SELECT MEASURES.[avg allergy count] ON 0, colord.MEMBERS ON 1 FROM patients

                         Avg Allergy Count
1 None                                 1.04
2 Blue                                 1.01
3 Green                                1.02
4 Orange                               1.01
5 Purple                               1.06
6 Red                                  1.03
7 Yellow                               1.00
For more examples, see %CELL, CURRENTMEMBER, IIF, and PROPERTIES.

See Also

Previous section   Next section