Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to compare if the 2 dates are the same?

Hi,

I am trying to get a total count of 2 columns of dates to find out if they are the same.

Date Account Created vs Date of Booking (those dates that are the same)

How do I go about getting it?

Thanks!

10 Replies
PrashantSangle

Sum(If(date2=date1,1,0))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

May be create a flag in the script

If([Date Account Created] = [Date of Booking], 1, 0) as DateMatchFlag

its_anandrjs

On front end you calculate or in the backend you need to compare this dates.

Regards

Anand

its_anandrjs

On front end if you calculate then try with

On Front End:-

Sum( If( Date Account Created = Date of Booking, 1 , 0 ) )


On Script Part:-


Load

if( Interval ( [Date of Booking] - [Date Account Created] , 'D hh:mm') = 0,1 , 0) as DateDiff

From Location;


Regards,

Anand

sunny_talwar

Hey Anand -

What is the point of adding interval function to create a flag?? Am I missing something here

Anonymous
Not applicable
Author

Thank you!

Anonymous
Not applicable
Author

Thank you!

its_anandrjs

Hi Sunny,

We can use simple IF also here which is also fine this i explain if we have hour and minutes difference then we calculate with the interval .

Regards,

Anand

sunny_talwar

Even if we have hours and minutes, we don't necessarily need Interval, right? Interval is just a formatting function... the underlying value is a number... so if you compare the number of formatted number, it should not make a difference