6 Replies Latest reply: Sep 28, 2017 9:30 AM by Sunny Talwar

# Percentage growth in chart

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.

WeekValueChange since last week(%)
10200-
11400100%
12300-25%
1345050%

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.

• ###### Re: Percentage growth in chart

May be this

(Sum(Value)/Above(Sum({<Week>}Value)) - 1) * Avg(1)

• ###### Re: Percentage growth in chart

You made quick work of it!

The following solution works perfect!

Sum(Value)/Above(Sum({<Week>}Value)) - 1

• ###### Re: Percentage growth in chart

Dear Sunny

(Sum(Value)/Above(Sum({<Week>}Value)) - 1) * Avg(1)

how  does  -1 work in this expression. pls explain

• ###### Re: Percentage growth in chart

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

• ###### Re: Percentage growth in chart

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

• ###### Re: Percentage growth in chart

PFA the app for your reference.

Regards

Pratyush