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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date as variable in a set analysis

Hello.

I'd like to compare the sales between a certain date (YYYY-MM) and the same period but a year before.

This certain date is a manually typed variable named MonthA.

I've been able to graph the sales of that exact month with the following expression, even thought it says 'Error in expression':

sum({$<time.MonthYear={'$(=date(date#(MonthA,'YYYY-MM'),'YYYY-MM'))'}>} Sales).

I've tried using two manually typed variables, MonthA and MonthB and it works but I'd like to accomplish the same with an expression.

sum({$<time.MonthYear={'$(MonthA)','$(MonthB)'}>} Sales)

I've tried using addyears(date(date#(MonthA,'YYYY-MM'),'YYYY-MM')),-1) but it doesn't work. Could you help me out?

Thanks a lot.

0 Replies