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: 
Asiolinka
Contributor II
Contributor II

date_difference + add_months combination in qlik

Hi All,

I need to rewrite below query from another language (no idea which one it is - sorry for this).

1./and date_difference_months(date1=todaydate, date2=birthdate)/12<65

2.//and date1 >= date_add_months(in_date=todayday, months=120 )

Do we have sth like date_difference in Qlik? 

I tried filednameas

1. if ( ((('2023-05-09'- "birthdate")/12)<65),1,0)

2.(If( ((datetocheck) >= ( AddMonths('2023-05-09', 120) )),1,0)) 

Any ideas? another options? Both rules should be add to another check. 

Labels (1)
2 Replies
Chanty4u
MVP
MVP

May be this 

if((Year(Today()) - Year(BirthDate)) < 65, 1, 0) as AgeCheck

 

 

if(Date1 >= Date(AddMonths(Today(), 120), 'YYYY-MM-DD'), 1, 0) as DateCheck

 

Asiolinka
Contributor II
Contributor II
Author

if((Year(Today()) - Year(BirthDate)) < 65, 1, 0) as AgeCheck 

Is it possible to replace  (Year(Today()) by (Year(2023-03-31)) ?