Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filling in fields with their previous vlaues

Hello Everyone,

I am working with an inventory transaction file which has the date of a transaction and the quantity of the material on that date. The dates are only for when there was a transaction so I created a full set of dates to fill in for the days when there was no transaction. Now I need to do the same thing with the quantities, filling in the quantities of the dates with the previous quanitiy for that material.

Example:

6/1/2011       25

6/2/2011            There was no transaction on this date, I added it and need to make the quantity value 25, the previous value

6/3/2011       19

If someone can help me out with this that would be great.

thanks!!

Alex

1 Reply
Not applicable
Author

Hi Alex,

the following script will do the job

Load

          Date,

          Qty as QtyOriginal,

          if(

          if(Qty='' and peek(Qty) <> '', peek(Qty),Qty) = '', peek(QtyNew),

          if(Qty='' and peek(Qty) <> '', peek(Qty),Qty)

          ) as QtyNew

Resident RawData

Hope this helps!

Stefan