In InterSystems MDX, a string expression can have any of the following forms:
A string literal (a double quote character, followed by any characters, followed by another double quote character). For example: "label" or "my property"
A numeric literal.
An expression that uses an MDX function to return a string. These functions include:
PROPERTIES, which returns the value of a property of a member. For example: homed.city.magnolia.PROPERTIES("Population")
See the reference section “Intrinsic Properties” for intrinsic properties that you can use.
IIF, which returns one of two values, depending on the value of a given logical expression.
LOOKUP, which looks up a given key in a term list and returns a substitute string.
%LOOKUP, which returns one value from a term list.
An expression that refers to a string-valued measure. For example, suppose that you define a calculated member as follows:
CREATE MEMBER patients.measures.stringtest AS 'IIF(MEASURES.[avg test score]<60, "low","high")'Copy code to clipboard
Then the expression MEASURES.stringtest is a string expression.
An expression that uses the MDX concatenation operator (+) to combine other string expressions. For example:
"string 1 " + "string 2"Copy code to clipboard
For another example:
"Pop: " + homed.city.magnolia.PROPERTIES("Population")Copy code to clipboard
A reference to a pivot variable that contains a string value. To refer to a pivot variable, use the following syntax:FeedbackOpens in a new window
Where variablename is the logical variable name. Do not enclose this expression with square brackets. This syntax is not case-sensitive; nor is the pivot variable name.
For information on defining pivot variables, see “Defining and Using Pivot Variables” in Using the Analyzer.
You can use string expressions in the following ways: