Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone help me with this script? I can't work out why amount is copying down only once, but not to any subsequent rows. If amount is null at all I would like to have the previous non null amount for an id copied down, but with my script it's only copying down to the first null line. Here is the script. many thanks
t1:
LOAD * Inline [
id, amount
1, 100
1,
1,
1, 400
2, 500
2, ];
t2:
NoConcatenate LOAD
id,
if(previous(id)=id, peek('amount'), amount) as amount2,
amount
Resident t1 order by id asc;
DROP Table t1;
try:
if(previous(id)=id, peek('amount2'), amount) as amount2
Thanks v much! after i wrote the question i just worked that out!
like tres qv try this
if(previous(id)=id, peek('amount2'), amount) as amount2