Announcements
cancel
Showing results for
Did you mean:
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.

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.

Br,

sujay.

1 Solution

Accepted Solutions
MVP

Try using Above()/Below() function

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

Try using Above()/Below() function

If(MonthYear, Sum(Measure)/Above(Sum({<MonthYear>}Measure)) - 1)
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.

MVP

Something like this

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

Hi Sunny,

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

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

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
ex-Training Manager at Qlik CEE