MicroStrategy ONE

Filtering based on a single value or string: Value prompts

Before You Begin

This topic assumes that you are familiar with the concepts in About prompts.

Steps to create a value prompt

Value prompts are useful when the result desired on the report is a single value, such as a specific date, a number, or a specific word or phrase. The value prompt is designed to return report results based on the data type assigned to the data in your data source. The value chosen by the user is compared to metric or attribute element values, and thus determines the data displayed in the report.

Value prompt example

For example, you want a report that lists all employees whose age is less than 40 years. You create a report with the Employee attribute and the Employee Age attribute. You create a Numeric value prompt while you are creating the report. The Numeric value prompt contains the Employee Age attribute, the operator Less than, and a Maximum Value set at 50.

Using the MicroStrategy Tutorial sample data, if you execute the report and answer the prompt by specifying 40 as the Employee Age, the final report looks like the following:

Report displaying employees under 40

Value prompts are typically used on a filter, where they become part of the filter's definition, but they can also be used on a metric as part of the metric's formula. The filter or metric is then placed on a report.

Currency conversion using a value prompt

An international company is based in the United States, so the data is saved in dollars in the data warehouse. However, an end user is based in Europe and wants to see revenue in euros. You need to create a report that converts revenue in dollars to euros.

The report prompts the user for a conversion rate, which is applied to a revenue metric. If a user wants to see dollars, he can enter a conversion rate of one.

The high-level steps are:

  1. Create a value prompt for the conversion rate.

    The prompt's instructions can include a website to find today's conversion rate, and also direct the user to enter a conversion rate of one to keep the revenue in US dollars.

  2. Use the conversion prompt in a metric. The metric's formula should look like the following, assuming revenue is the target fact and Euro Conversion Rate is the name of the prompt:

    (Sum(Revenue) {~} * ?[Euro Conversion Rate])

  3. Use the metric in the report.

In the US, the report is executed, and 1 is entered at the currency conversion prompt. The results are shown below:

Regional revenue report, in dollars

In Spain, the report is executed, and a conversion rate of .72263 is entered at the currency conversion prompt. The revenue data is multiplied by that number, and the results are shown below:

Regional revenue prompt in Spanish, using euros

Where to use value prompts

Value prompts are typically used in filters, but they can also be part of a metric formula or a custom group. In a filter or custom group, the value prompt is used within a metric qualification or an attribute qualification. It returns the value to compare the attribute or metric to. For example, if you create a metric qualification to limit the results of a report to values greater than a certain number, you can create a value prompt to allow the user to specify that number at run time. In a metric, a value prompt can be part of the formula. For example, you can create a value prompt, used in a price metric, to allow a user to specify a discount at run time. The filter, metric, or custom group is then placed on a report.

Because they are often used in filters, value prompts can be created directly in the Filter Editor at the same time that you create the filter in which you want to place the value prompt. When created this way, a value prompt is part of the filter's definition and is not a stand-alone prompt, so it cannot be added to another filter. To create a stand-alone value prompt, create it in the Prompt Generation Wizard. This gives you and other designers the flexibility to create a value prompt once and add it to various filters.

For a table of where to use all prompts, see Adding a prompt to a report, metric, filter, or custom group.

Types of value prompts

The different types of value prompts are listed below.

  • Date prompt, used for date data types, such as in a filter that qualifies on Year or Day.

    This value prompt type asks users to type or select a date, and returns data that has the date data type assigned to it and that matches the user's entered date. For example, the Date prompt can be useful when added to a filter that screens data based on Year=2026. The prompt lets users select a specific date within the year of the filter's condition.

  • Numeric prompt, which accepts integers or decimals up to 15 digits of precision. Use a numeric prompt to prompt for a number to be used, for example, in a metric formula or metric qualification.

    This value prompt type asks users to type a numeric value.

    If a user enters more than 15 digits for a numeric prompt, the data is converted to scientific notation. If precision is needed beyond 15 digits, you should use a Big Decimal value prompt instead.

  • Text prompt, used for a text string, such as in an attribute form qualification in a filter or custom group.

    This value prompt type asks users to type a string of text.

  • Big Decimal prompt, which accepts integers and decimals up to 38 digits of precision.

    This value prompt type asks users for a "big decimal" value.

    Use Big Decimal prompts only in expressions that require high precision, such as a qualification on a Big Decimal attribute ID.

  • Long prompt, which accepts integer numbers up to 10 digits.

    This value prompt type asks users for a long integer value.

    The long prompt is not enabled by default. To enable it, see Enabling the long value prompt.

For a more advanced discussion of value prompts, including an example of how to use a value prompt to convert currency for internationalization, see the Advanced Prompts chapter in the Advanced Reporting Help.

To create a value prompt

If you are in the process of creating a prompted filter, begin at step 5 of this procedure. This step places you at the correct page when the wizard is accessed from the Filter Editor or Custom Group Editor.

  1. Open the Prompt Generation Wizard. How?

  2. On the Welcome page, select Value prompt, then click Next. The Value Prompt page opens.

  3. Select one of the following types of value prompts:

    • Date and Time to qualify on a date or a range of dates. The date can include a specific time as well.

    • Numeric prompt to qualify on a metric.

    • Text prompt to qualify on attribute forms.

    • Big Decimal to qualify on a big decimal value for a metric.

    • Long prompt to qualify on a long integer value for a metric.

      Long prompt is displayed as an option only after you enable it.

  4. Click Next. The General Information page opens.

  5. Type a Title, which is used as the default object name when you save the prompt, although you can change it. The title is also displayed to users when the prompt is run during report execution.

    To display a blank title, type a space in the Title field. If you leave Title blank, a default name, such as Region for an attribute prompt on Region, is displayed when the prompt is run.

  6. Type text in the Instructions field, which is displayed when the prompt is run during report execution.

    To display blank instructions, type a space in the Instructions field. If you leave Instructions blank, default instructions, such as Qualify on Region for an attribute prompt on Region, are displayed when the prompt is run.

  7. If you are creating a date and time prompt, select whether to Allow user to select time from a list. This determines whether a list of times is displayed when the prompt is run.

  8. To determine how the prompt appears when it is executed in MicroStrategy Web, click Modify. The Web Options dialog box opens. This dialog box displays options for prompt style and style properties. For instructions, see Defining how a prompt is displayed in MicroStrategy Web.

  9. Personal answers allow a user to save prompt answers for this prompt, and then reuse the answers on any report that this prompt is used on. For a more detailed description of personal answers and how they can be used, see Allowing personal answers for prompts.To determine whether personal answers can be saved for this prompt, select one of the following options from the Personal answers allowed drop-down list:

    • None: No personal answers can be saved. Every time a user sees the prompt, he must answer it manually (if it is required) or ignore it.

    • One: Only one personal answer can be saved for this prompt. When the prompt is used again (on this report or a different one), the personal answer is displayed. A user can keep the personal answer, or add or delete selections. He can save his changes as a new personal answer, but only one personal answer can be saved for the prompt.

    • Multiple: Multiple personal answers can be named and saved, allowing different answers for the same prompt. When the prompt is used again (on this report or a different one), the personal answers are available. The user can select one of them, or answer the prompt manually.

  10. To define a range within which the user's answer must fall:

    • To set the lowest value allowed for the prompt answer, select the Minimum value check box. Enter the minimum.

      • For a date prompt, this is the earliest date.

      • For a text prompt, this is the fewest number of characters allowed in the text string.

    • To set the highest value allowed for the prompt answer, select the Maximum value check box. Enter the maximum.

      • For a date prompt, this is the latest date.

      • For a text prompt, this is the maximum number of characters allowed in the text string.

  11. To require that the user answer the prompt at run time, select the Promptanswerrequired check box.

  12. Click Next. The Default Prompt Value page opens.

    • A default answer can allow users to complete report execution more quickly, since they do not need to answer the prompt but can simply run the report using the default answer. The user can select the default, or create his own qualification. For considerations when determining a default answer, see Default prompt answers. You do not need to specify a default answer if you do not want a default answer to appear for users.

  13. If you do not want to define default prompt values, click Finish. The Save As dialog box opens.

  14. To create a default value:

    1. Select the Default value check box and enter the value in the text field.

    2. If you are creating a date prompt:

    • The drop-down button opens a calendar, from which you can select a date.

    • The Date Editor button opens the Date and Time Editor, which allows you to set a dynamic date, that is, a date or time range that meets specific offset conditions.

    • Click Finish. The Save As dialog box opens.

    •  
  15. To save your prompt, select the folder in which to save the new prompt, enter a name, and click Save to return to MicroStrategy Developer.

    If you are creating a prompted filter, you are returned to the Filter Editor after you click Finish. You do not save the prompt as a separate object. To return to the previous procedure, click About metric set qualifications or Steps to create a value prompt qualification.

All value prompts must be added to a metric, filter, or custom group (depending on the type of value prompt and what you want it to do), and then the metric, filter, or custom group is added to a report. For instructions, see:

For a table showing how to add each prompt type to objects, see Reports: Adding a prompt to a report, metric, filter, or custom group.

Related Topics