Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dirk_fischer
Creator
Creator

Inner join on timestamps not working

Hello experts,

I'm struggeling with a piece of code,where I can't explain the behaviour and hope to get some help here. I do an interval match on the field OPP_END and then I want to join the fields IPP_NO and %ID_IPP into the table OPBP. It working with one type of files, where the timestamp is accurate to a second. If I use another type of files, where the timestamps are more detailled (down to miliseconds) it's not working anymore, although after the interval match, the table OPBP still has all the datasets. So for some reason the inner join is not working, although I take the fields to join on directly from the table IPP.

Does anybody see something wrong in my code or is there some experience saying, keep to timestamps as numbers to avoid this Kind of Trouble?

Already in advance, thank you very much for your help.

Best regards,

Dirk

Inner Join (OPBP) IntervalMatch( OPP_END, %MACHINE_ID )

Load Distinct

  IPP_START,

  IPP_END,

  %MACHINE_ID

Resident IPP

Where IPP_NO > 0;

Let vNoOfRows = NoOfRows( 'OPBP' );

TRACE 'After join IntervalMatch OPBP has ' & '$(vNoOfRows)' & ' rows.';

Inner Join (OPBP)

Load Distinct 

  IPP_START 

  ,IPP_END 

  ,%ID_IPP 

  ,IPP_NO

Resident IPP

Where Exists(IPP_START) And Exists(IPP_END);

1 Solution

Accepted Solutions
sunny_talwar

Decimal numbers (such as time stamps) are prone to rounding errors. I think Inner Join based on a decimal is probably not a great idea. Look here on an article about Rounding Errors

View solution in original post

3 Replies
sunny_talwar

Decimal numbers (such as time stamps) are prone to rounding errors. I think Inner Join based on a decimal is probably not a great idea. Look here on an article about Rounding Errors

dirk_fischer
Creator
Creator
Author

Hi Sunny,

thank you very much for the hint. I converted the timestamp into an integer by using floor 0.0001 and multiplying the result by 10000. Now the interval match is working proper and the inner join also provides the expected results.

Regards,

Dirk

sunny_talwar

Awesome