Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If anyone is interested in an example of "fill with previous" - I posted it on Share QlikViews.
I suspect that the below will execute a little faster (fieldvalue() vs. distinct, fewer joins) and use less memory (temp field vs. temp table). I also have a feeling that there's a single-step solution, but I haven't come up with anything that works.
RIGHT JOIN (data)
LOAD
fieldvalue('Product',iterno()) as Product
,recno() as Month
AUTOGENERATE 12
WHILE len(fieldvalue('Product',iterno()))
;
LEFT JOIN (data)
LOAD
Product
,Month
,if(len(Qty)=0 and Product=peek(Product),peek(Qty2),Qty) as Qty2
RESIDENT data
ORDER BY Product,Month
;
DROP FIELD Qty;
RENAME FIELD Qty2 TO Qty;
Thanks for the comment John. The fieldvalue() idea looks interesting.