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: 
nirav_bhimani
Partner - Specialist
Partner - Specialist

Current Years Current Month Vs Last Year Same Month Sales

Hi All,

I am getting problem in calculating last Year Month Sales on Selection,

I have tried two set expression for that but in both the cases my expression working only when I am not selecting anything, If I select anything then it wont show any data. I am also attaching Sample Data.

eg.

Please provide any alternative for that.

Thanks & Regards,

Nirav Bhimani

1 Solution

Accepted Solutions
udit_kumar_sana
Creator II
Creator II

Hi Nirav,

Please find here the attached file for the solution of your issue.

Regards,

Udit

View solution in original post

2 Replies
udit_kumar_sana
Creator II
Creator II

Hi Nirav,

Please find here the attached file for the solution of your issue.

Regards,

Udit

jagan
Partner - Champion III
Partner - Champion III

Hi Nirav,

Use this expression for

Current Year Current Month

=Sum({<CalYear=, CalMonthYear=, CalMonth=, CalQuarter=, CalDate={'>=$(=MonthStart(Max(CalDate)))<=$(=MonthEnd(Max(CalDate)))'}>} Sales)

Last Year Current Month

=Sum({<CalYear=, CalMonthYear=, CalMonth=, CalQuarter=, CalDate={'>=$(=MonthStart(Max(CalDate), -12))<=$(=MonthEnd(Max(CalDate), -12))'}>} Sales)

Hope this helps you.

Regards,

Jagan.