Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rohan_chavan15
Contributor
Contributor

Last month vs Current Month till Date Comparison

hi ,

      I have a requirement where i need to figure out comparison of current month sales to last month sales till date.

For example if suppose today is 15/02/2018 then the current month sales will be till 15/02/2018 and in comparison column of last month the data will be from 01/01/2018 till 15/01/2018 . But by the following set expression i am getting the entier month data for Jan 2018 .

Set expression for last month :-

Count({<Year={$(=max(Year))},Month={$(=month(addmonths((Max(Date)),-1)))}>}Key)

1 Solution

Accepted Solutions
jerryyang756
Creator
Creator

Replace Month with Date Field . Generally I use

DATE={">=$(=MonthStart(AddMonths(Max(DATE),-1)))<=$(=AddMonths(Max(DATE),-1))"}

View solution in original post

2 Replies
jerryyang756
Creator
Creator

Replace Month with Date Field . Generally I use

DATE={">=$(=MonthStart(AddMonths(Max(DATE),-1)))<=$(=AddMonths(Max(DATE),-1))"}

rohan_chavan15
Contributor
Contributor
Author

Thanks it works fine