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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
vishsaggi
Champion III
Champion III

Time between two time stamps

Hello ,

I am looking for a set analysis statement to check a timestamp field between two time intervals.

I have timestamp field with time I want to check this field between two times

like

Timestamp between Time1= 9:00:00 Am and Time2 = 11:00:00

Regards,
V.

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Subtract the two times from each other: Time2 - Time1. You can use the interval function to format the result: interval(Time2-Time1, 'h:mm:ss').

If the time values are strings and not numbers then first convert them to numbers with the time# function. time#(Time1, 'h:mm:ss') as Time1. If they are timestamp strings then use the timestamp# function: timestamp#(MyTimeStamp, 'YYYY-MM-DD hh:mm:ss') as MyTimeStamp.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Subtract the two times from each other: Time2 - Time1. You can use the interval function to format the result: interval(Time2-Time1, 'h:mm:ss').

If the time values are strings and not numbers then first convert them to numbers with the time# function. time#(Time1, 'h:mm:ss') as Time1. If they are timestamp strings then use the timestamp# function: timestamp#(MyTimeStamp, 'YYYY-MM-DD hh:mm:ss') as MyTimeStamp.


talk is cheap, supply exceeds demand
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Can u share sample file ?

Regards,
Nagarjuna