Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
When using the previous function can you by any chance specify a column number?
I have some data like this
date | Time | vehicle | postcode | collection | collection_region | collection_postcode | delivery | delivery_region | delivery_postcode | last_stop_start_postcode | sort_order |
05/03/2018 | 16:04 | K66 | BS1 | No | Yes | BS1 | BS1 | 1 | |||
05/03/2018 | 23:59 | K66 | NP20 | End | End | NP20 | 2 | ||||
06/03/2018 | 06:58 | K66 | NP20 | Start | Start | NP20 | 3 | ||||
06/03/2018 | 07:03 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 07:06 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 07:46 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:01 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:02 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:04 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:06 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:07 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:09 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 08:10 | K66 | NP44 | Yes | NP44 | NP44 | No | 4 | |||
06/03/2018 | 11:30 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 | |||
06/03/2018 | 11:33 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 | |||
06/03/2018 | 11:34 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 | |||
06/03/2018 | 12:28 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 | |||
06/03/2018 | 12:31 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 | |||
06/03/2018 | 12:32 | K66 | BH12 | No | Yes | BH12 | BH12 | 4 |
I am trying to write an if statement which is something like:
IF(delivery_region = postcode and Previous(delivery = 'Start') and the delivery column = 'Yes' on the sort order 1 column),Previous(postcode)
So basically I am trying to extract NP20 from my data but only when the first column is a delivery. If delivery was "No" I would not want it.
Hope this makes sense?
Thanks
Hi,
I don't really understand what you're trying to do but Previous() is a script function.
look at above() and below() instead
Can you a bit more clear about the requirement?
This is basically off the back of this topic which i raised here - Delivery/Collection fields
This was answered perfectly but I would like to take it a step further now by trying to create an if statement as mentioned in my original post.
Thanks
I've figured out a way around this now, so this thread can be closed/deleted.
Thanks