Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In my chart visualisation I'm trying to set up a table where I can see the percentage change/growth of a value over time.
I have a table with Week in the first column and Value in the second column. To that I want to add a third column with a calculation of growth/change from week to week. Note that we cannot calculate the change for the first row since there is no previous week to compare to.
Week | Value | Change since last week(%) |
---|---|---|
10 | 200 | - |
11 | 400 | 100% |
12 | 300 | -25% |
13 | 450 | 50% |
How would this be calculated?
The solution doesn't have to be for weeks specifically but could just as well handle dates, months or years.
Thank you for your time.
May be this
(Sum(Value)/Above(Sum({<Week>}Value)) - 1) * Avg(1)
PFA the app for your reference.
Regards
Pratyush
You made quick work of it!
The following solution works perfect!
Sum(Value)/Above(Sum({<Week>}Value)) - 1
Dear Sunny
(Sum(Value)/Above(Sum({<Week>}Value)) - 1) * Avg(1)
how does -1 work in this expression. pls explain
Hi Upali
Since you want to compare the current value with the previous one, using fractions the above expression would turn out to be:
(Sum(Value)/Above(Sum({<Week>}Value)) - 1) * Avg(1)
=(Sum(Value)-Above(Sum({<Week>}Value)))/Above(Sum({<Week>}Value)) * Avg(1)
(Sum(Value)-Above(Sum({<Week>}Value))) denotes --> Current - Previous
Above(Sum({<Week>}Value)) denotes --> Previous
Regards
Pratyush
You calculate growth like this, right
(This-Previous)/Previous
If I expand the equation... it will look like this
This/Previous - Previous/Previous
Which is nothing but this
This/Previous - 1