Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping load with 1 key for two fields

Hi all,

I have the following problem. I need to check wether a shipment is delivered within a certain timeframe (defined with a start and endtime) at a depot. The key for these depots are the day and the depot name. However for certain depots I have 2 timeframes for a day. Now I need a way to check for both time frames if the shipment is delivered within the time frame. Any help is greatly appreciated!

2 Replies
vincent_ardiet
Specialist
Specialist

Hi,

Instead of a mapping load, have you try to join your shipment table with your depot table with IntervalMatch (using the extended syntax) ?

Considering that:

- Shipments and TimeFrames are loaded

- Shipments contains at least DepotName and DeliveredTime

- TimeFrames contains DepotName, Start and End

- TimeFrames can contain many lines with the same depot name

You will have a script like this:

Left Join (Shipments)

IntervalMatch (DeliveredTime, DepotName)

Load

  Start,

  End,

  Depot

Resident TimeFrames ;


Drop Table TimeFrames ;

Then, Shipments table will have two more fields Start and End. You can use those fields to create a flag if you don't want to keep them.

Regards,

Vincent

Not applicable
Author

Hi Vincent,

Thanks for your reply. It is partially correct since I also need to do an aggregation on Depot Level to determine if a shipment is in one of the timerframes.