MDX Builder

Analysis Services

Analysis Services

MDX Builder

Use this dialog box to create an expression in the Multidimensional Expressions (MDX) syntax. For information about the MDX functions in Microsoft® SQL Server™ 2000 Analysis Services, see MDX Function List.

This dialog box is displayed from dialog boxes and wizards in which an MDX expression can be specified.

Options

MDX expression

Build the MDX expression using the Data box, Functions box, Insert button, arithmetic operator buttons, and number buttons.

Note  The Data and Functions boxes provide a convenient means for building valid expressions. You can double-click or drag values from both boxes to the MDX expression box.

You can also type an expression directly into the MDX expression box. You may need to use this method if you want to add functions from libraries other than the Analysis Services MDX function library.

Data

View the data structures in the object to which the MDX expression applies.

Functions

View the functions in the Analysis Services MDX function library and any additional libraries that have been registered. For information about an individual Analysis Services MDX function, select it, and then press F1.

To add a function to the MDX expression box, place the cursor where you want to insert the function, select a function in the Functions box, and either double-click or click Insert. The function syntax appears in the MDX expression box. Replace arguments and their delimiters (« and ») with the appropriate values.

Insert

Click to add the item selected in the Data box or Functions box to the MDX expression.

Arithmetic operator buttons

Click to add operators to the MDX expression.

Number buttons

Click to add numbers to the MDX expression.

Register

Click to display the Register Function Libraries dialog box, where you can register an external function type library (*.olb, *.tlb, *.dll). The new library appears in the Functions box. For more information, see Register Function Libraries Dialog Box.

Usage Notes

You can use the following techniques when you create MDX expressions:

  • Null keyword

    You can use the keyword Null to create an MDX expression that has a null value.

  • Temporary alias for a set

    A set in a function can be given a temporary alias for use within the function by using the keyword As. In this example, the set {State} is given the temporary alias S1 so it can be referred to later in the function in a nested iteration:

    Sum({State} As S1, Sum(Geography.CurrentMember.Children,
    Population * Val((Geography.CurrentMember.Properties("CityTax")) + 
    Val(S1.Current.Properties("StateTax")))))