Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Zee29
Contributor II
Contributor II

Month over month comparison

Hello Everyone,

I am having some issues getting the Month over Month.  I know my issue is with the previous month calculation. I created variables for current and previous month. The problem is when I select a month my MoM returns a zero. I added images to show what happens when I make a selection.

Current Month

Sum({$<MonthYear ={'$(=vMaxYearMonth)'}>} Provider )

Previous Month

Sum({$<MonthYear={"$(=vPreviousMaxMonth)"}>}Provider)

Provider MoM

Zee29_0-1617854701417.pngZee29_1-1617854751996.png

 

(   Sum({$<MonthYear ={'$(=vMaxYearMonth)'}>} Provider )
-
Sum({$<MonthYear={"$(=Date(AddMonths(Max(MonthYear),-1),'MMM-YY'))"}>}Provider)
)
/
Sum({$<MonthYear={"$(=Date(AddMonths(Max(MonthYear),-1),'MMM-YY'))"}>}Provider)

1 Solution

Accepted Solutions
Quy_Nguyen
Specialist
Specialist

Hi,

I meant excluding it like this:

Current Month

Sum({$<MonthYear ={'$(=vMaxYearMonth)'}, [createdDate.autoCalendar.YearMonth]=>} Provider )

Previous Month

Sum({$<MonthYear={"$(=vPreviousMaxMonth)"}, [createdDate.autoCalendar.YearMonth]=>}Provider)

View solution in original post

4 Replies
Quy_Nguyen
Specialist
Specialist

Hi, 

Since you are selecting on field createdDate.autoCalendar.YearMonth, try excluding it from the set analysis.

Or use the MonthYear field for the Dimension/Filter

Zee29
Contributor II
Contributor II
Author

Hello @Quy_Nguyen ,

I tried using it in my filter but I'm only seeing the current month not the previous month when I make a selection

 

Quy_Nguyen
Specialist
Specialist

Hi,

I meant excluding it like this:

Current Month

Sum({$<MonthYear ={'$(=vMaxYearMonth)'}, [createdDate.autoCalendar.YearMonth]=>} Provider )

Previous Month

Sum({$<MonthYear={"$(=vPreviousMaxMonth)"}, [createdDate.autoCalendar.YearMonth]=>}Provider)

View solution in original post

Zee29
Contributor II
Contributor II
Author

@Quy_Nguyen  Thank you!!! It worked