Interval Match for Time Dimension

Friends lets more discussed about the Interval Match function with an little bit simple example. In many times we have the information is available in the different tables and when we need some information which is not in the proper way. But we need the report from that tables and dimension.

Have a look with simple example of the Order table and the Event generated table that is information of the orders and the event generation.

If we look around the Order log table structure that carries the fields named  Start , End & Order. Wherever start is the order start time and End is Order End time and the Order carries the Order Name and it looks like

LOAD * Inline
Start , End , Order
01:00 , 03:35 , A
02:30 , 07:58 , B
03:04 , 10:27 , C
07:23 , 11:43 , D


And the Event Log structure carries Time  , Event & Comment. Wherever the Time has information of the Event generation and for this time what is Event number or name here we have Event number and same like for Comment we have details that which event has the information that is what event has do on that time means comments. And structure of the table looks like

LOAD * Inline
Time  , Event , Comment
00:00 , 0 , Start of shift 1
01:18 , 1 , Line stop
02:23 , 2 , Line restart 50%
04:15 , 3 , Line speed 100%
08:00 , 4 , Start of shift 2
11:43 , 5 , End of production

So here first we load this tables in the Qlikview and we need the report like that event time is in which range in the OrderLog table.

1. Let we see for the Event 1 and compare it with the OrderLog table that comes in Order A in 01:00 and 03:35 Start and End time.

2. Like ways if we check for Event 3 for compare with the OrderLog so that is come under Order B and Order C also because the start and End times is in between the 02:30to 07:58 for Order B and for Order C it is in 03:04 to 10:27. So there are many event like ways are come under the different orders.

So for this we have a interval match table with script

IntervalMatch( Time )  LOAD Start,End Resident OrderLog;

And the complete for report for the
Time, Event, Comment, Order, Start, End