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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TMAP Filter - comparing 2 dates columns

Hello, 

I am very new and would like to ask a simple question.

There is a function in TMap that allows me to compare 2 dates. My goal is to remove the rows where the 2 dates are the same. 

The 2 rows i am comparing are TRADE_DATE and EXPIRY

TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0

The 2 data inputs are are date data types. 

When i run this, i get an error "Type mismatch: Cannot convert from date to string

Please help

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    The condition TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0 will output the value in the form of Boolean (true or false) since you are checking a condition.

 

    So the output of the above condition should be mapped to a boolean variable. Similarly, your input data should be in date format and not in String. I believe one of your input data is a date value in String format. So you will have to first convert the data to Date data type using ParseDate function.

 

    If your data types are correct, you will get output as shown below.

0683p000009M7MN.png

 

0683p000009M7Vn.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

2 Replies
TRF
Champion II
Champion II

Can you share your tMap with schemas?
Anonymous
Not applicable
Author

Hi,

 

    The condition TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0 will output the value in the form of Boolean (true or false) since you are checking a condition.

 

    So the output of the above condition should be mapped to a boolean variable. Similarly, your input data should be in date format and not in String. I believe one of your input data is a date value in String format. So you will have to first convert the data to Date data type using ParseDate function.

 

    If your data types are correct, you will get output as shown below.

0683p000009M7MN.png

 

0683p000009M7Vn.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved