Lists and Sets
A list or set is a collection of data points or tuples.
Syntax & Usage
or
- Lists or sets must generally be enclosed with curly brackets.
- If the list is generated from a functional method, the curly brackets are not required.
- The data points or members (which are just data points with a single member) should be supplied as a comma delimited list using the standard syntax for data points, or as a functional element that generates a list of data points or member names.
- A list of data points or members can have duplicate elements. If composite data points are provided (e.g. (member A, member B) ) from 2 different dimensions, each of the supplied data points in the set MUST follow the same data points structure, in the same naming order (e.g. (dimension A, dimension B) etc).
- Lists are used in Semantic Calculations.
Different Function types
- This function is like the MDX set object.
- If the data point is described by a single member, the list can effectively be a list of hierarchical members.
Examples
This example is a list of countries: Australia, Canada and England. Since each is a single member data point, the names do NOT need to be enclosed in round brackets:
{ [Customer].[Country].[Australia], [Customer].[Country].[Canada] , [Customer].[Country].[England] }
This example produces a list of all members in the country hierarchy:
{ AllMembers([Customer].[Country])}
This example produces a list of all members in the country hierarchy. Because "AllMembers" is functional, in most situations, the curly brackets are not required:
AllMembers([Customer].[Country])
This example produces a list of composite data points: Australian Sales, US expenses, Canadian Profit. Notice that each data point follows the same structure (country member, measure):
{ ([Customer].[Country].[Australia], [measures].[sales]) , ([Customer].[Country].[US], [measures].[expenses]) , ([Customer].[Country].[Canada], [measures].[profit]) }