Working with Custom MDX and Edit Formula options
You can define lists with MDX formulas. To display the Edit Custom MDX dialog select the <Edit Formula> or Custom MDX options wherever they appear in the List Designer. For example, you can create a filter with custom MDX.
SeeUsing custom MDX.
The Edit Custom MDX dialog contains three buttons:
- Click to display a list of elements which can be used.
- Click to display lists of variables and objects which can be used.
- Click to display a list of functions to use in the formula.
You can enter these:
Text:
="text"
For example, ="element_unique_name"
.
Object property:
=ObjectName.PropertyName
where ObjectName is the name of a global variable, POV, global list or a local object.
PropertyName is the name of a property of the specified object. for example, text
or attribute.
For example, =Variable_name.Text
or
=ListView2.Attribute
A combination of texts and object properties joined with an ampersand (&)
=[ObjectName.Property]&["Text"]
For example, =Variable.Text & "Level"
Examples
The examples are based on the Best Practices sample database supplied with Application Studio () and use a hyperblock created from the Product dimension.
See these topics:
Use a global variable in structure selection:
[Product].[All Tires].[Car Tires Summer]In the List Designer, click .
- Click .
- From the Elements list in Selection Settings, select .
- In the Edit Custom MDX dialog, click and double-click the UniqueProduct variable in the list of global variables.
View Mode lists the two children of 'Summer Tires'.
Use MDX functions in structure selection:
These examples use an MDX function to return the children of the first child element of the Product dimension (All Season Tires).
- In the List Designer, click .
- Click in the toolbar.
- In the Edit Custom MDX dialog, specify [Product].firstchild and click .
You can use this method to achieve the same result:
- In the List Designer, click .
- Click .
- From the Elements list in Selection Settings, select .
- In the Edit Custom MDX dialog, click and double-click the element of which to display the children. For example, All Tires.
- The string
[Product].[All Tires]
is displayed. - Change the string to
[Product].firstChild
and click .
Use global lists:
=List.ListName.Text
For example, =List.Product.Text
returns the first element of the list.