Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Antoine
Contributor III
Contributor III

Struggling with IntervalMatch (One row not matching like the others...)

Hello ! 

I've been pulling my hair on an issue for enough time now, and I think I might need your expertise at this point !

I'm doing a simple interval match, for some dates, between two tables. The first one contains the machine and the history of the state type of the machine (meaning when each state starts and ends, and the kind of state), the second one the type of product produced, and when it started and stopped. I just want to make them match together, so I made an intervalmatch.

 

It seems that unfortunately my IntervalMatch doesn't work for some rows from time to time, I had a look at the raw datas, and they seems identical... (File Test 2.xlsx)

Here's the loading script:

//START UNDER

AnalysePerformance:
LOAD
[workplace] as [Workplace],
imputationDate as [Keydate],
[stateType],
(Interval([endDate]-[startDate],'hh:mm:ss')) as [stateTypeTime],
If(Len(Trim([endDate]))=0,Timestamp(Now()+5/(24*60), 'DD/MM/YYYY hh:mm:ss'),endDate) as FinEtat, 
[shift],
If(Len(Trim(note))=0,'(Empty)',note) as [WorkplaceStateHistory.Note],
sourceWorkplaceSubset as workplaceSubset
FROM [lib://Data/Qlik BIR\Test 2.xlsx]
(ooxml, embedded labels, table is WPSH);

ManufacturingStateHistory:
LOAD
workplace as [Workplace],
manufacturingOrder,
Date([startDate]+(1/86400),'DD/MM/YYYY hh:mm:ss') as [startDate],
If(Len(Trim([endDate]))=0,Timestamp(Now()+5/(24*60), 'DD/MM/YYYY hh:mm:ss'),Date(endDate,'DD/MM/YYYY hh:mm:ss')) as endDate
FROM [lib://Data/Qlik BIR\Test 2.xlsx]
(ooxml, embedded labels, table is MSH);


Left Join ([AnalysePerformance])
IntervalMatch(FinEtat,[Workplace]) 
Load
[startDate],
endDate,
[Workplace]
Resident ManufacturingStateHistory;

//END ABOVE

I changed the inner to a left join, and here's what I get :C1.PNG

where I should get a StartDate and an endDate too... (And the exact same as the one above and under...)

(I've disable the next steps of the intervalmatch, as I haven't fixed this for now...)

 

Thanks in advance for your valuables inputs, as I clearly have no idea what is going on with that row...

Regards,

Antoine

1 Reply
Antoine
Contributor III
Contributor III
Author

For an unknown reason, if I change the endDate from the 1st Table, from 43627,15625 to either 43627,15624 or 43627,15626

then it is correctly matched with the 43626,89583 to 43627,27083 ... Do someone know why it's working that way ?