Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Here you go:
When selection is made (Year = 92 and Month 03)
When no selection made
Attaching the qvw for your reference.
HTH
Best,
Sunny
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
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
can you please share the sample data because you have mentioned it includes date issue also
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
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 ?
Not sure I completely understand your following question:
do the peek and previous work when I use the rowno () function?
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
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/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 |
Is this what you are trying to get?
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