Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

1 Solution

Accepted Solutions
sunny_talwar

May be this

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

View solution in original post

6 Replies
sunny_talwar

May be this

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

prat1507
Specialist
Specialist

PFA the app for your reference.


Regards

Pratyush

Anonymous
Not applicable
Author

You made quick work of it!

The following solution works perfect!

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



upaliwije
Creator II
Creator II

Dear Sunny

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


how  does  -1 work in this expression. pls explain

prat1507
Specialist
Specialist

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

sunny_talwar

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