Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Previous month Calculations with Set analysis in QlikSense

Hi Everyone,

Can any one help me on this topic...,

I have a data like below,

Year, MonthName, Sales

2016, Jan, 1000

2015,Dec, 570

2016, Feb, 300

Based on the above example, I have a filters called YEAR, MONTH, If i select JAN Month and 2016 year,  i want to see the Dec 2015(Previous month) Sales, Can you please help me how i need to write set analysis for this...

If possible kindly send me the QlikSense file

1 Solution

Accepted Solutions

Re: Previous month Calculations with Set analysis in QlikSense

See attached qvf

3 Replies

Re: Previous month Calculations with Set analysis in QlikSense

See attached qvf

Re: Previous month Calculations with Set analysis in QlikSense

Hi,

Yes its possible,  Try below Code.

Data:

Load *,Date(Date#(Year&'/'&MonthName,'YYYY/MMM')) as Date Inline [

Year, MonthName, Sales

2016, Jan, 1000

2015,Dec, 570

2016, Feb, 300

];

Now you can use beow expression to get previous month data.

Sum({<Date = {"$(=Addmonths(Max(Date),1))"},MonthName=,Year=>}Sales)

Regards,

Kaushik Solanki

Not applicable

Re: Previous month Calculations with Set analysis in QlikSense

Hi Gysbert,

Thanks a lot.. Based on your formula.. my report  is working..