Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
mikevmalta
Partner - Contributor III
Partner - Contributor III

Intervalmatch end not matching

Hi,


I am using Intervalmatch to assign the time field a time bucket, ex. 13:04:59 -> 1 - 2 pm

However I am facing a situation where the time value matching the End field are not being properly mapped to a time bucket,i.e. 08:59:59 -> Null() whereas the time bucket must be 8 - 9 am. Can anyone please help me solve this issue?

Mike

Labels (1)
1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

Try to Add to Trim like below..

TimeBuckets:
LOAD
     
Trim(maketime(RecNo()-1,0,0)) as Start,
     
Trim(maketime(RecNo()-1,59,59)) as End,
     
trim(mid(time(maketime(RecNo()-1),'h tt'),1,2)) & ' - ' & trim(time(maketime(mod(RecNo(),24)),'h tt')) as                [Time Bucket]
     
AUTOGENERATE(24);



Check the Attachment..

View solution in original post

3 Replies
settu_periasamy
Master III
Master III

Hi,

Try to Add to Trim like below..

TimeBuckets:
LOAD
     
Trim(maketime(RecNo()-1,0,0)) as Start,
     
Trim(maketime(RecNo()-1,59,59)) as End,
     
trim(mid(time(maketime(RecNo()-1),'h tt'),1,2)) & ' - ' & trim(time(maketime(mod(RecNo(),24)),'h tt')) as                [Time Bucket]
     
AUTOGENERATE(24);



Check the Attachment..

jonathandienst
Partner - Champion III
Partner - Champion III

These are probably caused by values that are either slightly more* than (for example) 8:59:59 and therefore fall into the 1 second gap between 98:59:59 and 09:00:00. You could reduce the size of the gaps to a much smaller value:

    maketime(RecNo()-1,0,0) as Start,

    Time(maketime(RecNo() - 1, 0, 0) - 1E-9) as End,

* this could be due to very small rounding errors caused by the date/time calculations.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
mikevmalta
Partner - Contributor III
Partner - Contributor III
Author

Hi settu_periasamy and jonathan,


Thank you both for your replies. Worked great!

Kind Regards

Michael