Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have created a table with this line of code:
NoConcatenate
Final2:
Load
BSPL_Inventory_Material_Number,
BSPL_Posting_Date_Monthname,
Aggr_Qty,
If(Len(Aggr_Qty)>0, Aggr_Qty,peek('Aggr_Qty')) as Aggr_Qty2
Resident Dates order by BSPL_Inventory_Material_Number,BSPL_Posting_Date_Monthname;
Drop Table Dates;
Here's the output:
For each Material there are all months from Dec 2010 till Aug 2024. Aggr_Qty is only present for those months where posting was done. Now I want to do such that between each posting value i.e Aggr_Qty, the previous value should be repeated till the next Non-null Value. For that I created Aggr_Qty2 (check the code above). For some reason it is working but the value is only repeating for only the next row in order and not all rows. How to solve this?
@ISK try below
If(Len(Trim(Aggr_Qty))=0, peek('Aggr_Qty2'), Aggr_Qty) as Aggr_Qty2