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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out 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.

Labels (1)
0 Replies