MicroStrategy ONE

Using Prompts within MDX Cube Metrics

If you are creating new metrics in your MDX cube, you can also include MicroStrategy prompts with the metrics. When the metrics are included on a report and the report is run, the prompts are displayed to the user for completion. This adds flexibility to your queries, allowing users to determine the data to see on the report.

This section covers the general requirements and process to include prompts in MDX cube metrics. See How to Build Analysis into Metrics with Custom MDX for information about how to include prompts within custom MDX of MDX cube metrics.

For metrics created with compound metric techniques without any custom MDX, you can include a prompt in the metric definition. For metrics created using MDX expressions, you must use the ApplySimple function to include prompts in the metric definition.

The following types of prompts can be included with MDX cube metrics:

  • Element list prompts defined on an attribute of the associated MDX cube
  • Value prompts
  • Object prompts defined on objects of the associated MDX cube

For information on how prompts can be included in an MDX cube report and the supported prompt types, see Prompts on MDX Cube Reports. For a review of all prompt types, see the Basic Reporting Help.

Before you can use prompts in MDX cube metrics, you need to import MDX cubes from your MDX cube source into MicroStrategy. For steps to import MDX cubes, see Importing MDX Cubes.

To use prompts in MDX cube metrics

  1. In Developer, log in to a project that is connected to an MDX cube source. Only one user can edit a project at a time.
  2. Choose Schema > MDX Cube Catalog.

    If the project connects to more than one MDX cube source, choose an MDX cube source database instance from the Select the Database Instance drop-down list, and then select an MDX cube source database instance and click OK to open the MDX Cube Catalog.

  1. Choose Cube Mapping.
  2. From the Catalog\Cube drop-down list, select the MDX cube to create metrics for.
  3. Choose Edit > Add New Compound Metric.
  4. Enter your expression in the Definition pane of the Metric Editor. For example, you can enter expressions similar to the following:

    • ([Discount Amount] * ?constantprompt)

      This expression applies a special discount amount, entered by the user running the report. In this example, it is assumed that constantprompt is the name of a value prompt in the project and Discount Amount is a metric within the MDX cube.

    • ApplySimple("([Measures].[Revenue],#0)", ?CategoryElementPrompt)

      This expression creates a Revenue metric, which is conditional on an element list prompt answered by the user running the report. Users can then choose to view revenue data for different categories such as Books or Music. In this example, it is assumed that CategoryElementPrompt is the name of an element list prompt in the project that references a Category attribute within the MDX cube.

  5. Click Save and Close.
  6. In the Object name text field, enter a name for your metric.
  7. Click Save.
  8. Click Save and Close.

Related Topics

Creating Metrics from MDX Cube Data