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: 
Anonymous
Not applicable

Displaying data between two time ranges

Dear All,

I have data available in a similar timestamp format : 11/2/2016  11:28:00 AM.

I have a requirement wherein I need to display records/data between a particular time range ie. 9:00 AM to 5:00 PM using the above timestamp.

Could you please with this query.

22 Replies
Anil_Babu_Samineni

Try to use this in list box and show the image

Interval(Date#([Creation Date], 'MM/D/YYYY hh:mm:ss TT') - Date#(Timezone, 'hh:mm:ss TT'), 'hh:mm')

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Doesn't work.

mdmukramali
Specialist III
Specialist III

Hi,

Can you try this.

where Time(frac([Creation Date]))>=MakeTime(9,0,0) and  Time(frac([Creation Date]))<=MakeTime(17,0,0);

Anonymous
Not applicable
Author

Hi Mohammed, Perfect. It worked. Thank you. Could you explain how it works?

mdmukramali
Specialist III
Specialist III

Hi,

From [Creation Date] first took Fraction Part which is Time then Applied Time Format to it.

and I have used MakeTime Function to define the Time 9 Am and 5 PM.

then compared both Time Values.


PFA for reference.



Thanks,

Mukram.



Anonymous
Not applicable
Author

Oh great, got it. Thank you so much. Quick question, if I wish to display the data between 5 PM and 1 AM, would the expression look like this ? where Time(frac([Creation Date]))>=MakeTime(17,0,0) and  Time(frac([Creation Date]))<=MakeTime(1,0,0);

mdmukramali
Specialist III
Specialist III

Hi,

you can try this.

Where Time(frac([Creation Date]))<=MakeTime(1,0,0) or Time(frac([Creation Date]))>=MakeTime(17,0,0);

mdmukramali
Specialist III
Specialist III

Hi Joshua,

joshpala

Do you have any further questions?

If not, then please close this thread by marking correct and helpful answers.

so it will helpful for others who are looking for similar solution.

Thanks,

Mukram.

Anonymous
Not applicable
Author

Thank you for helping out Mohammed

Tanya_Sharma9
Contributor
Contributor

Hi Mukram,

I have the same query, I need to use an expression in a line chart to display data for one hour. I have a 'TimeStamp' column which is on my X Axis(Dimension) , but when I used your expression in my 'Field' section, it didn't work. Could you please help me resolve the same ?

Tanya_Sharma9_0-1621505670055.png