Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey all,
I have a dataset with stock levels per day from last year till now. However, from a certain date (30-10-2021) there is no stock level measured every sunday. So I would like to copy the stock level from the saturday to the sunday (as there are no transaction in the weekends).
After reading some related topics tried several options but it doesn't work. See attached an example dataset for one articlenumber (there are multiple article numbers in the actual dataset).
What I tried in script:
1. If(Weekdag = 'zo' and Date >= '30-10-2021', Peek(aantalNew), aantal) as aantalNew
2. If(Weekdag = 'zo' and Date >= '30-10-2021', Peek(aantalNew,-1), aantal) as aantalNew
However, this gives me the same output as sum(aantal).
What am I doing wrong?
HI @Giel0
I would try
If(Weekdag = 'zo' and Date >= '30-10-2021', Previous(aantalNew), aantal) as aantalNew
Hey @Mark_Little ,
I tried your solution but first I got the error message 'couldn't found aantalNew'. So tried below formula but again get the same output as sum(aantal)
If(Weekdag = 'zo' and Date >= '30-10-2021', Previous(aantal), aantal) as aantalNew