Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have a table like this with only daily number. I want insert a 'cum' column which has daily values added up till date.
When I load while loading file I am getting 'above' is invalid error.
Date | dailyno | Cum |
07-01-2017 | 10 | 10 |
07-02-2017 | 20 | 30 |
07-03-2017 | 40 | 70 |
07-04-2017 | 30 | 100 |
07-05-2017 | 20 | 120 |
07-06-2017 | 30 | 150 |
07-07-2017 | 20 | 170 |
07-08-2017 | 10 | 180 |
07-09-2017 | 40 | 220 |
07-10-2017 | 20 | 240 |
rangesum(above(dailyno),0,rowno())) did not work for me.
Here is how I tried this.
LOAD
date,
dailyno
FROM [lib://main (qlik_admin)/dailydata.qvd]
(qvd);
I have loaded extra coloumn, it did not work
LOAD
date,
dailyno,
rangesum(above(dailyno),0,rowno()))
FROM [lib://main (qlik_admin)/dailydata.qvd]
(qvd);
The help is appreciated. Thank you.
Hi,
Try like below,
Data:
LOAD
Date,
dailyno,
RangeSum(dailyno, Peek('CumSum')) AS CumSum;
LOAD * INLINE [
Date, dailyno,
07-01-2017, 10
07-02-2017, 20
07-03-2017, 40
07-04-2017, 30
07-05-2017, 20
07-06-2017, 30
07-07-2017, 20
07-08-2017, 10
07-09-2017, 40
07-10-2017, 20
];
Hi,
Try like below,
Data:
LOAD
Date,
dailyno,
RangeSum(dailyno, Peek('CumSum')) AS CumSum;
LOAD * INLINE [
Date, dailyno,
07-01-2017, 10
07-02-2017, 20
07-03-2017, 40
07-04-2017, 30
07-05-2017, 20
07-06-2017, 30
07-07-2017, 20
07-08-2017, 10
07-09-2017, 40
07-10-2017, 20
];
Hi,
Above function works in charts only. If you want it there,
Try like this
Rangesum(
Above (
DailyNo, 0, rowno()
)
)
In front end use this expression
rangesum(above(total dailyno,0,RowNo(total)))
Try This expression
RangeSum(Above (Total Sum(dailyno),0,RowNo(Total)))
Hi,
This seems ok on the script you can check this
LOAD
date,
dailyno,
Rangesum ( Above( dailyno ), 0 , Rowno( ) ) ) as CummDailyNO
FROM [lib://main (qlik_admin)/dailydata.qvd]
(qvd);
Regards
Anand
Thanks Devarasu. It worked like Charm!
The above function won't be accepted in the data load. It is accepted only in the expression. But thanks for your reply. I appreciate the help.
The above function won't be accepted in the data load. It is accepted only in the expression. But thanks for your reply. I appreciate the help.
Hey Anand, The above function won't be accepted in the data load. It is accepted only in the expression. But thanks for your reply. I appreciate the help.