MicroStrategy ONE
Value Prompts
Value prompts are used when the information needed at run time is a single value of a specific data type. The value chosen by the user is compared with either an attribute form or a metric. This comparison can be done in a filtering criteria or in a custom group.
The different types of Value prompts are:
- Date prompts for a date value.
- Numericprompts for a numeric value. Numeric value prompts accept integers or decimals up to 15 digits of precision.
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.
- Textprompts for any type of text.
- Big Decimal prompts for a big decimal value. Big Decimal value prompts accept integers and decimals up to 38 digits of precision.
Big Decimal prompts should only be used in expressions that require high precision, such as qualifying on a Big Decimal attribute ID.
- Long prompts for a long integer value. Long prompts accept integer numbers up to 10 digits.
Although long prompts are not part of the options available by default for selection, you can enable them as part of your project preferences. To enable them:
- Double-click your project to open it.
- In MicroStrategy Developer, choose Tools > My Preferences. The My Preferences dialog box opens.
- Expand the General category on the left, and select Prompts.
- Select Add long prompts to the list of available value prompts.
- Click OK.
Value prompts allow specification of maximum and minimum values to be applied.
Example: Value Prompt
For procedures to create value prompts, see the MicroStrategy Developer help or the Building Query Objects and Queries, for Designers chapter of the Basic Reporting Help.
Report Requirement
Create a report showing sales since a certain date.
Solution
Prompt the user for the date since they want to see sales data. The value they choose is applied to a filter criteria for the attribute Date. The prompt here is included in the filter on a report.
Example: Currency Conversion
Report Requirement
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. Create a report that converts revenue in dollars to Euros.
Solution
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:
- 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.
- 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])
- 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:
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: