Month-to-Date metric

239 Views Asked by At

I have a situation where the metric calculation(Month to Date Sales) is based on the month from the report date filter.

We want the month to date filter to be for the report month and not the current month - in other words, if the user selects 03/10/2015 for the report date, we want the month sales to be the sales for March, and not the sales for June.

Is there a way to parse the report date to extract the report month into a variable that can be used in the ‘where' clause of the metrics in order to generate the desired results.

Thanks in advance.

1

There are 1 best solutions below

0
On

I am not entirely sure if this answers your question, but achieving something like this may be possible when using disconnected timeline date filter. Your metric should look like this:

SELECT Sales_metric BY Month/Year (Date) ALL OTHER WHERE Month/Year (Date) = (SELECT MAX(Month/Year (Timeline)) BY ALL OTHER EXCEPT Date (Timeline))

I hope this helps, in case if it doesn't feel free to log a ticket to GoodData Support at [email protected].