Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

the best way of date comparison

Hi Folks, i got a question,

there are two date fields: confirmed date and scheduled date, they do look like:

confirmed date       scheduled date

03.10.2018                15.11.2018

01.12.2018                15.12.2018

03.12.2018                12.01.2019

my question is: how can i compare these dates,

confirmed date     scheduled date

03.12.2018                12.01.2019

one solution that i have found does look like:

(if(right(year(confirmed date),4) < right(year(scheduled date),4) , 1, 2 ) as flag  (here i compare two fields by using of function right() and year().

my question is, what if, if i should compare the date fields like:

confirmed date      scheduled date

03.10.2018                15. 11. 2018           (to compare between 2 Months)

01.12.2018                15.12.2018             (to compare within one Month)

 

Does anybody have any idea how to resolve this issue? Thanks a lot in advance

 

Beck

Labels (1)
10 Replies
beck_bakytbek
Master
Master
Author

Thanks a lot for your help and feedback