Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikmark1990
Contributor III
Contributor III

Change a variable in LOAD statement except for the first row in field

I tried to update a variable in the LOAD statement for every row of a table that is loaded by using the statement except for the first row. A part of my script is:

LET startsaldoLiquideMiddelen = NUM(29700);

LOAD JaarWeek																				AS #JaarWeek,
NUM(NUM($(startsaldoLiquideMiddelen)) - NUM(CreditBedragOpen) + NUM(DebetBedragOpen), '#.##0')					AS SaldoLiquideMiddelen
RESIDENT Cashflow;

My goal is to create the field SaldoLiquideMiddelen that equals to 29700 for the first row and got the new value to insert in the second row. The third row needs the output of the formula where the second value is the input value. The fourth value is the output of the formula where the third value is the input and so on. How do I change the variable for each row except the first row?

Labels (2)
1 Reply
Gysbert_Wassenaar

Perhaps like this

LET startsaldoLiquideMiddelen = NUM(29700);

LOAD 
JaarWeek AS #JaarWeek, NUM(If(RowNo()=1, $(startsaldoLiquideMiddelen) , Peek(SaldoLiquideMiddelen)) - NUM(CreditBedragOpen) + NUM(DebetBedragOpen), '#.##0') AS SaldoLiquideMiddelen RESIDENT Cashflow;

 


talk is cheap, supply exceeds demand