Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i calculate growth rate?

Hi everyone,

I have time series data, saved as variable X(t), As you know it varies by time. So I want to calculate the growth rate for X(t) month by month! But it does not work in Qlikview!!

And the my time format is not compatible with Qlik time format!!

The growth rate=(X(t)-X(t-1))/X(t-1)

I would appreciate it if some one could give me some pieces of advice.

Thank you in advance

1 Solution

Accepted Solutions
sunny_talwar

Here you go:

When selection is made (Year = 92 and Month 03)

Capture.PNG

When no selection made

Capture.PNG

Attaching the qvw for your reference.

HTH

Best,

Sunny

View solution in original post

25 Replies
sunny_talwar

Are you trying to do this on the front end or the script? if in the script you will need to use the Peek or Previous function and if you are trying to do in  front end, you can achieve the same by using RangeSum(Above() or Below()) function. For more help on this topic, you will have to share more information.

Best,

Sunny

Not applicable
Author

Hi,

I hope it will help u to complete the task

lo:

LOAD * Inline [

sl.no,name,salary

01,balu,16646

02,bif,61646

03,AK,111111

];

LOAD *,

((salary-Previous(salary))/Previous(salary))*100 as %growth

Resident lo;

Thank you

balaji.k

avinashelite

can you please share the sample data because you have mentioned it includes date issue also

Not applicable
Author

Dear Sunny,

Thank you for replying.

Yes, I used the rowno () (as date format dos not match the Qlik date format), above() and below() functions in front end. do the peek and previous work when I use the rowno () function?

And I wonder if you can let me know what is the difference between sum and rangesum.

best regards,

Zahra

sunny_talwar

You can find the difference between Sum() and RangeSum if you see gwassenaar‌ comments on this thread: Re: what is the range of sum function ?

sunny_talwar

Not sure I completely understand your following question:

do the peek and previous work when I use the rowno () function?

Not applicable
Author

Dear balaji k,

Thank you very much but it works when data is sorted or there is some kind of ranking. Am I true?

In another word, can I use the rowno() function in script?


best,

Zahra

Not applicable
Author

Dear Avinash R,

Thank you, Yes of course.

as usual numbers 1-12 are the months and 93 , 92 are the years but the problem is that the months do not matches the Qlikview Date and calender.

    t                         X(t)

92/0171565187
92/0288710966
92/0388138813
92/0492719741
92/0595968043
92/06102555007
92/0798895752
92/0892763772
92/0993568153
92/1094379721
92/11105969263
92/12125155154
93/0193854421
sunny_talwar

Is this what you are trying to get?

Capture.PNG

Script:

Table:

LOAD RowNo() as Sort,

  *; 

LOAD * Inline [

Time,  Value

92/01, 71565187

92/02, 88710966

92/03, 88138813

92/04, 92719741

92/05, 95968043

92/06, 102555007

92/07, 98895752

92/08, 92763772

92/09, 93568153

92/10, 94379721

92/11, 105969263

92/12, 125155154

93/01, 93854421

];


Created a straight table with Time as dimension and three expressions:

1) =Sum(Value)

2) =Above(Sum(Value))

3) =Sum(Value)/Above(Sum(Value))-1

HTH

Best,

Sunny