%LIST (MDX)
Returns a comma-separated list of values, given a set of values. This function is an InterSystems extension to MDX and is intended for use in KPIs.
Returned Type
This function returns a string that consists of a comma-separated list of values.
Syntax and Details
%LIST(set_expression)
Where:
-
set_expression is an expression that evaluates to a set, typically a set of members or tuples.
Example
The following example shows the measure %COUNT for each diagnosis, followed by a string that contains a comma-separated list of those values:
WITH SET temp AS 'diagd.MEMBERS'
SELECT MEASURES.[%COUNT] ON 0, {temp,%LIST(temp)} ON 1 FROM patients
Patient Count
1 None 8,603
2 asthma 676
3 CHD 345
4 diabetes 546
5 osteoporosis 212
6 LIST 8603,676,345,546,212
In the following example, the LIST column contains, for each city, a comma-separated list of the birth counts by decade for that city. This is the basic query used in the scorecard on the Scorecard with Trend Lines dashboard.
SELECT {MEASURES.[%COUNT],%LIST(birthd.decade.MEMBERS)} ON 0, homed.city.MEMBERS ON 1 FROM patients
Patient Count LIST
1 Cedar Falls 1,079 11,22,42,92,115,159,176,135,127,179,21
2 Centerville 1,058 3,24,51,57,114,157,167,152,161,145,27
3 Cypress 1,095 12,14,57,84,105,146,160,159,153,166,39
4 Elm Heights 1,086 8,22,54,72,121,154,168,135,176,143,33
5 Juniper 1,152 9,21,56,79,124,165,200,152,169,155,22
6 Magnolia 1,152 6,18,55,83,116,181,190,159,172,145,27
7 Pine 1,120 8,22,47,72,108,160,166,173,161,170,33
8 Redwood 1,132 6,17,61,90,109,174,189,129,171,154,32
9 Spruce 1,126 11,20,70,74,107,167,171,161,164,156,25
Note:
This function is intended for use in KPIs displayed in scorecard widgets. Specifically, you use this as the source value for a scorecard property that displays a trend line or trend bar graphic.