Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

marmengou010880
New Contributor

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
MVP
MVP

Re: RangeSum and script

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

marmengou010880
New Contributor

Re: RangeSum and script

Thank you so much,

it worked perfectly

Community Browser