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: 
MOliva1607097091
Contributor
Contributor

compare a date with a date-pattern to understan the month, day or year

Hello to all,

I would like to compare the dates to a pattern to understand which month those dates belong to.

for example I want to compare 04-04-2020 with dd-11-yyyy to understand if the date is in November.

my idea was to use it in tMap:

row1.birth_date.equals (dd-11-yyyy)? "ok": "not november"

but it doesn't work, do you have any ideas?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

The function equals () is used to check if the two strings are equal. If you want to get part of a date, use this function. TalendDate.getPartOfDate(String partName, Date date),for example:

TalendDate.getPartOfDate("MONTH", row1.dateColumnName)+1==11?"ok": "not november"

 

Regards

Shong

 

View solution in original post

2 Replies
Anonymous
Not applicable

Hi

The function equals () is used to check if the two strings are equal. If you want to get part of a date, use this function. TalendDate.getPartOfDate(String partName, Date date),for example:

TalendDate.getPartOfDate("MONTH", row1.dateColumnName)+1==11?"ok": "not november"

 

Regards

Shong

 

MOliva1607097091
Contributor
Contributor
Author

thank you so much! 😀