Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to compare between date field and a date value?

hi,

can I please have your assistance with defining properly a count if statement, i would like to count all the id's when their time_stamp is equal to yesterday date.

my initial try (which didnt succeeded of course):

count(distinct if(date(time_stamp)=Today-1,id))

*time_stamp - date+hour field in my data set

*id - unique key value in my data set

thanks,

Tal

2 Replies
vinieme12
Champion III
Champion III

Hi

when you do today()-1 you will be returned a number not a date

so try

count(distinct if(FLOOR(timestamp#(time_stamp,'MM/DD/YYYY hh:mm:SS'))=Today()-1,id))


i've assumed your time_Stamp format to be = MM/DD/YYYY hh:mm:SS << replace as per your format

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MarcoWedel

try with

DayName(time_stamp)

or

DayStart(time_stamp)

or just

Floor(time_stamp)

instead of

date(time_stamp)

as date() does not change the numerical part of a dual value.

hope this helps

regards

Marco