3.3.6 Changing OFFSET to LAG

Options
EmmaPF
EmmaPF Member, ALL USERS, Partner Posts: 5 Occasional Contributor

Hi all,

 

Having some issues changing the OFFSET function to LAG. Using the following formula;

LAG(PO Submitted, Final Shipping Time Weeks, 0)

My Final Shipping time in weeks is 1 for the PO submitted column, the lag I am seeing is however 2;

EmmaPF_0-1641485970254.png

 

The only way I can get the LAG to show up correctly is by checking multiple override shipping method Booleans covering the weeks that the delivery should occur;

EmmaPF_1-1641486121701.png

Based on this it seems that the Confirm PO delivery is picking up the correct line for the shipping method (otherwise the override amount would never show up) but that it is picking up the time lag information from the target column rather that the value to offset column i.e. If there is a value in offset amount look back to see what the value to offset is.

 

Looking at the possible Boolean combinations this is possibility holds;

EmmaPF_2-1641486686014.png

Per above 

Week 2 - offset amount = 1 returns the value to offset from the previous week, week 1

Week 3 - offset amount = 2 returns the value to offset from 2 weeks earlier, week 1

 

Very confused as from reading the technical documentation it looks like LAG is supposed to 'push' a figure forward by the offset amount rather than retrieve it from an earlier period (LEAD function?)

 

Any help most welcome!

 

Emma