Monthly Archives: September 2017

Adding a prompt to a filter based on a metric

Hello there,

If you need to add a prompt to a filter based on a metric, you just need to do this:

  1. Create a filter using a metric in a report;
  2. In the parameters, just use Custom for the expression;
  3. Insert an Applysimple function. Ex.:

ApplySimple(“Dateadd(Month, Datediff(Month, 0, DATEADD(m, -#0, current_timestamp)), 0)”,? Months)

4.   In this example, I’m using a Months prompt to get an integer answer from the user to fill the #0 wildcard.

The trick here is the put the prompt name as: ? NAME_OF_THE_PROMPT

Hope it helps.

God bless you.