MDX.SET.CPICK
Get an element from a set and display its caption.
You get an element from a set using the MDX.SET.CPICK formula. You can define the set with a MDX statement 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 view. The Select Element dialog displays the set.
Syntax
=MDX.SET.CPICK(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 function CHILDREN.
=MDX.SET.CPICK("FoodMart
2008","Sales","[Time].[2004].CHILDREN"; "[Time].[2004].[Q1]")
Query | Explanation | Set |
---|---|---|
[Time].[2004].Children
|
This set contains all descendants of [2004] in the dimension [Time]. |
[2004].[Q1],
|
Double-click the formula, and select an element 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.CPICK("FoodMart
2008","Sales","TopCount([Product].[All Products].CHILDREN,2,[Unit
Sales])","[Product].[All Products].[Drink]")
Query | Explanation |
---|---|
|
This function selects the two elements with the highest sales figures ([Unit Sales]) from the set of the descendants of [Product].[All Products]. |
Double-click the formula, and select an element in the Select Element dialog. You cannot drill down to elements that are not in the set.