Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sujayrpatil
Partner - Contributor III
Partner - Contributor III

Month vs Previous month comparison

Hi All,

I have a scenario where I have to compare the users count for each month wrt users count in previous month and show as percentage change. 

I have attached the snap of number of users per month.

snap.jpg

required bar chart should have the change over every month.

example:  for the June month bar , the  calculation should be (June  count -May count)/(May Count) 

i.e (191-177)/177 = 0.11.

Request for your support.

Br,

sujay.

1 Solution

Accepted Solutions
sunny_talwar

Try using Above()/Below() function

If(MonthYear, Sum(Measure)/Above(Sum({<MonthYear>}Measure)) - 1)

View solution in original post

6 Replies
sunny_talwar

Try using Above()/Below() function

If(MonthYear, Sum(Measure)/Above(Sum({<MonthYear>}Measure)) - 1)
sujayrpatil
Partner - Contributor III
Partner - Contributor III
Author

Hi Sunny,

 

Thanks for the solution it worked fine for me.

But  what if I have to show the change over 2 dimensions like may be in a Line graph if I want to show change over month and also on app (month on x axis and app as lines in y axis). Then how can i calculate the change.

Thanks in advance.

sunny_talwar

Something like this

Aggr(
  If(MonthYear, Sum(Measure)/Above(Sum({<MonthYear>}Measure)) - 1)
, AppDimensionName, MonthYear)
sujayrpatil
Partner - Contributor III
Partner - Contributor III
Author

Hi Sunny,

 

Thanks for your response, but sorry it isnt working for this scenario.

airflight90
Contributor II
Contributor II

Hi Sunny,

  Would you please explain the logic for this expression?  I thought the If statement will need a condition " if (condition, true, false)" .  Thank you

Michael

piotr-bratek
Creator
Creator

Hi Sunny,

what's the syntax ? You do not equate MonthYear to some values ...

Sum({<MonthYear>}Measure)

Is that equal to {<MonthYear= >} ?

If not, how does it work? Is there any official material about it? 

The most experienced Qlik Trainer in Central Europe