I am trying to create a metric for a date last year
for example my selected date filter is 2/01/2021 - I want the answer to be 2/01/2020
I also would like to be able to subtract months as well so 02/01/2021 would be 01/01/2021
Best answer by Iva GasparekovaView original
I assume, the prebuilt functionality of Time over Time Comparison isn't exactly what you are looking for, but you can certainly create some Time-over-Time Analytics this way.
Or you can build your own metric/measure via Metric editor and it should be similar to my example below:
I am not sure what you are saying what I am trying to create is something like this
startdate=Select min(Date (Billingdatekey))- 1year
enddate=Select max(Date (Billingdatekey))- 1year
that way I can get a metric like this
saleslastyear = select sales where Billingdatekey between startdate and enddate
Sorry for my misunderstanding of your use-case. Now I understand that you'd like to create something like Min and Max Dates Using Date Arithmetic.
Please be aware, this solution is greatly dependant on your model. Please check the example model and MAQL in our documentation and let me know if it is doable in your project.