Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rohan_chavan15
New 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
pritamb89
Contributor

Re: Last month vs Current Month till Date Comparison

Replace Month with Date Field . Generally I use

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

2 Replies
pritamb89
Contributor

Re: Last month vs Current Month till Date Comparison

Replace Month with Date Field . Generally I use

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

rohan_chavan15
New Contributor

Re: Last month vs Current Month till Date Comparison

Thanks it works fine