Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
pauledrich
Creator
Creator

Static 'to' Date

Thanks in advance for your help on this topic...

My objective is to create a script entry to calculate from historical dates to a set period in time which in this instance is static 31/3/2014.

My script currently calculates the historical date to today to give me a 'MonthsAgo' amount like:-

12*Year(today()) - year("HistoricDate")) + Month(Today()) - Month("HistoricDate")  as  MonthsAgo

I have tried multiple combinations of the above replacing Year(today()) with '31/3/2014' which isn't returning the desired result.

Any ideas where I am going wrong?

Regards

P

1 Solution

Accepted Solutions
Not applicable

Maybe:

12*(2014 - year("HistoricDate")) + 3 - num(Month("HistoricDate"))  as  MonthsAgo

reg

D

View solution in original post

2 Replies
Not applicable

Maybe:

12*(2014 - year("HistoricDate")) + 3 - num(Month("HistoricDate"))  as  MonthsAgo

reg

D

pauledrich
Creator
Creator
Author

Thank You - works perfectly and logical.