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: 
rammuthiah
Creator III
Creator III

Date Logic

I have a date format like

1. date(YYYY-MM-DD) and

2. date(YYYY-MM-'28') as Date

I have to compare 2 dates if 1>2,'Late','Not Late'.

When I tried it always showing as false condition

9 Replies
chinnuchinni
Creator III
Creator III

you can try with this,

if(num(date(datefield1,'YYYY-MM-DD')) >num(date(datefield2,'YYYY-MM-DD')) ,'Late','Not Late')

chinnuchinni
Creator III
Creator III

=if(num(date(MakeDate(2011,01,12),'DD-MMM-YYYY')) > num(date(MakeDate(2011,01,6),'DD-MMM-YYYY')),'Yes','No')

MK_QSL
MVP
MVP

You mean to say you want to compare all dates with 28th of the same month?

Please clarify so that we can help further.

rammuthiah
Creator III
Creator III
Author

Yes.

sasiparupudi1
Master III
Master III

=if(Num(date#('2018-01-29','YYYY-MM-DD')) >num(date#('2018-01-28','YYYY-MM-DD')) ,'Late','Not Late')

sasiparupudi1
Master III
Master III

if not working, pl provide some example dates

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Where is your data coming from, i.e. database?

In some instance it's best to FLOOR the date and format the output before you can compare the 2 fields.

Gabriel

dwforest
Specialist II
Specialist II

if(datefield < monthstart(datefield) + 28,'Not late','late')

dwforest
Specialist II
Specialist II

oops + 27