Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
wuming79
Creator
Creator

How to count if only between date and time?

Hi

I have a small sample table with data below:

Index | time_bin | 

1 | 2019-02-03 23:59

2 | 2019-02-03 15:00

3 | 2019-02-02 20:00

4 | 2019-02-01 12:00

 

I like to do something like 

count( IF(time(time_bin )>='2019-02-03 00:00:00' AND time(time_bin )<='2019-02-03 23:59:59', time_bin ))

My current results keep showing zero. Is there a function to convert my time_bin to read date and time and do the conditional check before count?

Labels (1)
2 Replies
Channa
Specialist III
Specialist III

pass those two dates into variable try below

 

=count(time_bin={">=$(vYearStart_Join)<=$(vYearCurDate_Join)"}>} distinct Time_Bin)

 

 

 

 

Channa
wuming79
Creator
Creator
Author

Hi,

I tried the code below but the results is empty.

=count(BF_RDP_timestamp={">=$('2019-02-03 07:00:00')<=$('2019-02-03 07:15:00')"}>} distinct BF_RDP_timestamp)

Did I put the syntax correctly?