Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
maxalander
New Contributor III

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

Re: Percentage growth in chart

May be this

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

6 Replies

Re: Percentage growth in chart

May be this

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

prat1507
Valued Contributor

Re: Percentage growth in chart

PFA the app for your reference.


Regards

Pratyush

maxalander
New Contributor III

Re: Percentage growth in chart

You made quick work of it!

The following solution works perfect!

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



upaliwije
Contributor II

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

prat1507
Valued Contributor

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