Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

RangeSum and script

Hi community,


I have the following table and I need to obtain accumulated information.

tabla.png

In the graph I use the formula:

RangeSum (above (sum (Input-Output), 0, RowNo ()))

and the result obtained seems correct

gráfico.png

I would need to perform this operation in the script by creating a table with the díacalendario field and the result I get for each day in the chart.


Thanks

2 Replies
maxgro
MVP
MVP

Maybe this

T1:

load * inline [

Dia, Input, Output

1/1/2018, 100, 50

2/1/2018, 50, 50

3/1/2018, 60, 50

4/1/2018, 70, 50

5/1/2018, 80, 50

];

T2:

NoConcatenate LOAD

     Dia,

     Input, Output,

     Input + Alt(Peek('CumInput'),0) as CumInput,

     Output + Alt(Peek('CumOutput'),0) as CumOutput,

     Input - Output + Alt(Peek('CumDelta'),0) as CumDelta

Resident T1

Order By Dia;

DROP Table T1;

1.png

Anonymous
Not applicable
Author

Thank you so much,

it worked perfectly