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

How to compare time part of timestamps

Hello,

I'm trying to create some courier delivery codes from timestamps but am struggling to figure out the correct date/time functions to use.

So for example, if a timestamp has a time part of 9am, the delivery code is '9AM'. Similarly, if a timestamp is before 12pm (and not equal to 9am) then the code is 'AM'.

For the 9am code I have tried a few things like the below but none of them give the expected result....

If(Time(Timestamp(PromisedDelivery, 'hh:mm')) = MakeTime(9), '9AM', 'Other')

Can anyone point me in the right direction?

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

as timestamp is a number

you could do something like

if(frac(PromisedDelivery)*24=9 ,'9AM','Other')

if find it much more easy to  compare two integers

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

as timestamp is a number

you could do something like

if(frac(PromisedDelivery)*24=9 ,'9AM','Other')

if find it much more easy to  compare two integers

Anonymous
Not applicable
Author

Brilliant. Thank you!! 🙂