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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources 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

Hi,

 

What's the complete code executed for the "diff_date" var ??

 

PS : You can activate the Code Mode to see exactly where is the problem !

Anonymous
Not applicable
Author

Sorry forgot to mention that. That error is at   Var.format_date  as the code.

And the complete code to date_diff is as;

Proff_tmp.diff_date = TalendDate

.diffDate(Var.Current_date,

Var.format_date, "dd");

 

 

Anonymous
Not applicable
Author

Ok i get it !

Change type of your updatetimestamp column to date type !

 

Good luck

SGV

 

Anonymous
Not applicable
Author

I tried that. It gives following error.

 

The method parseDate(String, String) in the type TalendDate is not applicable for the arguments (String, Date)

 

Anonymous
Not applicable
Author

Hello,

The method TalendDate.parseDate() needs String date not Date date. You can use TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("dd/MM/yyyy")) to achieve your goal.

Best regards

Sabrina

Anonymous
Not applicable
Author

Thanks for the input but that gets me bellow error;

 

The method formatDate(String, Date) in the type TalendDate is not applicable for the arguments (String)

 

Anonymous
Not applicable
Author

Hi,


@brawal wrote:

Thanks for the input but that gets me bellow error;

 

The method formatDate(String, Date) in the type TalendDate is not applicable for the arguments (String)

 


Would you mind posting your current expression setting screenshot in tMap into forum?

Best regards

Sabrina

Anonymous
Not applicable
Author

I have mentioned on the original post. The expression is as;

 

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

 

And screenshot;

0683p000009LsOC.jpg

 

 

Anonymous
Not applicable
Author

Please let me know if you are not clear.