Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load order for hour of day

I'm having trouble getting an hour of day order set up to count calls made during certain hours. the format i have is h TT - h+1 TT (e.g. 2 PM - 3 PM). This is the line of code i'm using in the script to define that:

time(maketime(Hour([calltime])), 'hh TT') & ' - ' & time(MakeTime(Hour([calltime])+1), 'hh TT') as [Call Hour]

I tried using a mapping load for call hour order starting with 12 AM - 1 AM as 1, 1 AM - 2 AM as 2, etc. and then sorting by call hour order as an expression but that didn't work. any thoughts?

1 Solution

Accepted Solutions
Not applicable
Author

You could create another field (or make Call Hour dual) in which you display Call Hour as number, like 12 AM - 1 AM will be 0001 and 1 AM - 2 AM = 0102 and 2 PM - 3 PM = 1415.

View solution in original post

3 Replies
Not applicable
Author

You could create another field (or make Call Hour dual) in which you display Call Hour as number, like 12 AM - 1 AM will be 0001 and 1 AM - 2 AM = 0102 and 2 PM - 3 PM = 1415.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dual(time(maketime(Hour([calltime])), 'hh TT') & ' - ' & time(MakeTime(Hour([calltime])+1), 'hh TT'),

time(maketime(Hour([calltime])), 'hh TT') ) as [Call Hour]

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

thanks to both for their responses