MDX.SET.MPICK

Select an element from a set with the MDX.SET.MPICK formula. You can define the set with an MDX expression in the formula, or refer to an existing set. The element is displayed with its caption.

To select an element, double-click the formula in the formula report. The Select Element dialog displays the set.

Syntax

=MDX.SET.MPICK(Alias,Cube,Query,Element Choice)

Arguments

This table describes the arguments of the function:

Argument Description Example
Alias Name of the database alias Foodmart 2008
Cube Name of the cube [Sales]
Query MDX expression that defines the set, or the name of the set [Time].[2004].[CHILDREN
Element choice Unique name of the element displayed first [Time.[2004].[Q1]

Example

In this example you define a set using the MDX statement CHILDREN MDX.

=MDX.SET.MPICK("FoodMart 2008","Sales","[Time].[2004].CHILDREN", "[Time].[2004].[Q1]")

Here, CHILDREN gets all children of [Time].[2004].
Query Explanation Set
[Time].[2004].Children The set contains all descendants of [2004] in the dimension [Time]

[2004].[Q1],

[2004].[Q2],

[2004].[Q3],

[2004].[Q4],

You can double-click the formula and select from these elements in the Select Element dialog. You cannot drill down to elements that are not in the set.

Example

In this example you define a set using the MDX function TopCount:

=MDX.SET.MPICK("FoodMart 2008","Sales","TopCount([Product].[All Products].Children,2,[Unit Sales])","[Product].[All Products].[Drink]")
Query Explanation
TopCount(([Product].[All Products].Children,2,[Unit Sales]) This function selects the two elements with the highest sales figures ([Unit Sales]) from the set of descendants of [Product].[All Products].

You can double-click the formula and select from these elements in the Select Element dialog. You cannot drill down to elements that are not in the set.

Related topics