Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
AquaCapriLyn
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

AquaCapriLyn
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)

AquaCapriLyn
Contributor II
Contributor II
Author

@Quy_Nguyen  Thank you!!! It worked