Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Gysbert_Wassenaar

See attached qvf


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

See attached qvf


talk is cheap, supply exceeds demand
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Gysbert,

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