MicroStrategy ONE

Filtering on a dynamic date based on a prompt answer

Steps to create a dynamic date based on a prompt answer

You can base the dynamic date on a prompt answer, rather than today's date. For example, you want to see daily revenue for the last month, starting at a particular date. If the specific date is 11/8/09, you want to see the daily revenue from 10/8/09 until 11/8/09, as shown in the report sample below:

To do this, create a prompt for a date. Use that date prompt in a filter that returns the dates between the date selected in the prompt and one month before the prompt answer. For instructions to re-create this example, see the Advanced Filters chapter of the Advanced Reporting Help.

Prerequisites

This procedure assumes that you are familiar with:

To create a dynamic date based on a prompt answer

    • Create the date prompt

  1. On the File menu, point to New, and choose Prompt. The Prompt Generation Wizard opens.

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

  3. Select Date and Time, then click Next. The General Information page opens.

  4. Type a Title, such as Target Date.

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

  6. Select Prompt answer required.

  7. Click Finish. The Save As dialog box opens.

  8. Select the folder in which to save the new prompt, type Target Date as the Object Name, and click Save to return to MicroStrategy Developer.

    • Create the filter

  9. On the File menu, point to New, and choose Filter. The Filter Editor opens.

  10. If the New Filter dialog box opens, double-click Empty Filter to open the Filter Editor.

  11. Drag the Day attribute from the Object Browser to the Filter definition pane. The Attribute Qualification pane opens.

  12. Select ID from the Qualify On drop-down list.

  13. Select Between from the Operator drop-down list.

  14. Drag the Target Date prompt from the Object Browser to the text box for the first value, as shown below. The cursor will change to a + when it is in the correct position.

  15. When you drop the prompt, the text box changes to Shortcut to: Target Date, and the drop-down list changes to Simple Prompt.

  16. Select Custom from the second drop-down list.

  17. Type the following in the second text box:

    • AddMonths(

  18. Drag the Target Date prompt from the Object Browser to the second text box.

  19. Type the following at the end of the second text box:

    • , -1)

  20. The interface should now look like the following:

  21. Click OK to return to the Filter Definition pane.

  22. Save and close the filter, naming it 1 Month Ago from Prompted Date.

    • Create the report

  23. Open a new report.

  24. Add the Day attribute and the Revenue metric.

  25. Drag the 1 Month Ago from Prompted Date filter from the Object Browser to the Report Filter pane.

  26. Save the report, then execute it.

Related Topics