Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
moath
Contributor III
Contributor III

Change in price between months (inflation)

I need to calculate the price inflation between month to month. for example, I would like to see the price increase/decrease for service A between the month of July and August, and August and September(consecutive months). what is the suitable function to do this?

moath_0-1638688390938.png

 

2 Solutions

Accepted Solutions
rubenmarin

Hi, you can use Before() to access the previous column, like: RangeSum(Value,-Before(Value))/Before(Value)

This needs at least two months to calculate.

If the service increase/decrease should not be affected by other selections it will better to have it precalculated in script.

View solution in original post

rubenmarin

Hi, if doesn't shows could be becuase ther is more than one Value, so you need to use an aggregation function like Sum() or AVG(), so:

RangeSum(Sum(Value),-Before(TOTAL Sum(Value)))/Before(TOTAL Sum(Value))

View solution in original post

8 Replies
rubenmarin

Hi, you can use Before() to access the previous column, like: RangeSum(Value,-Before(Value))/Before(Value)

This needs at least two months to calculate.

If the service increase/decrease should not be affected by other selections it will better to have it precalculated in script.

moath
Contributor III
Contributor III
Author

Hi, what if I need to calculate inflation between Dec 2021 and Jan 2022?

also how can I apply the same logic on the Total? 

moath_0-1638701340885.png

 

Thank you in advance

rubenmarin

Hi, in that case you'll need to add a 'TOTAL' clause to the Before function:

RangeSum(Value,-Before(TOTAL Value))/Before(TOTAL Value)

moath
Contributor III
Contributor III
Author

Thanks  it's working!

One more query, how can I show the inflation  between the totals as shown below?

moath_0-1638780018516.png

 

rubenmarin

Hi, if doesn't shows could be becuase ther is more than one Value, so you need to use an aggregation function like Sum() or AVG(), so:

RangeSum(Sum(Value),-Before(TOTAL Sum(Value)))/Before(TOTAL Sum(Value))

moath
Contributor III
Contributor III
Author

Thank you  !

Senor_Dai
Partner - Creator II
Partner - Creator II

Hi @rubenmarin ,

This looks like this could also help me...🤞..

Essentially, I'm trying to give user's a one word 'Increasing' or 'Declining' month-on-month into a variable based on monthly User Sessions of one of our QlikSense Apps..   So, if we have sessions from Apr 2023 to now, is there a way to inform the user what the 'trend' is?

Can this be accomplished?

Kind regards,

 

Dai

rubenmarin

Hi, yes, using above solution it could be something like:

If(Sum(Value)>Before(TOTAL Sum(Value)), 'Increasing', If(Sum(Value)<Before(TOTAL Sum(Value)),'Decreasing','Equal'))

But if this can be precalculated in script, in a table by user and month htat already has stored if the user increases or decreases will have better perfomance, this can be done if there is nonen or only a few selections that can affect the result of each user-month.

And a last thing, if you have a question different than the one in the thread it will be better to open a new question to avoid to messing the thread. You can add links as reference in your own question.