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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

incremental load tMap help

Hi, I am trying to do the incremental load of XML files. I do have date column on yyyy-MM-dd HH:mm:ss which is row2.updatedtimestamp. On first row I am trying to convert my string type data to date format. On the second row I am trying to get the current time.

On the third row I am doing the date differennce with the my date column (row2.updatedtimestamp) with flag.

But the problem is that I am keep getting error as;

Type mismatch: cannot convert from Date to String.

Could you please let me know what is wrong? I also have shared the screenshot of job

 

Expression Type Variable
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row2.updatedtimestamp ) Date format_date
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",TalendDate.getDate("yyyy-MM-dd HH:mm:ss")) Date Current_date
TalendDate.diffDate(Var.Current_date,Var.format_date,"dd") == 126 ?true:false Boolean Out_Flag

 

0683p000009LsG9.jpg

Labels (3)
10 Replies
Anonymous
Not applicable
Author


Do This:

- If row2.updatedtimestamp is of type Date then use below expression for format_date
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",row2.updatedtimestamp) )

- If row2.updatedtimestamp is of type String with value like "23-05-2017" and you want a format like "2017-05-23 12:34:00" then use below expression for format_date
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",TalendDate.parseDate("dd-MM-yyyy",row2.updatedtimestamp))

- Change the data type of variable format_date to String