How to convert this sql case statement for tmap

Highlighted
Eight Stars
Eight Stars

How to convert this sql case statement for tmap

Hi talend folks,

 

How to convert this sql case statement for tmap  

case
when CHL= 'S' then date_trunc('day',"DATE")
end DATE

Thanks
RAJ
Highlighted
Sixteen Stars
Sixteen Stars

Re: How to convert this sql case statement for tmap

Hi,

To have the result as a date try this:

row1.CHL == 'S' ?
 TalendDate.parseDate("dd/MM/yyyy", TalendDate.formatDate("dd/MM/yyyy", row1.yourField))) : row1.yourField

Hope this helps.

 

 


TRF
Highlighted
Sixteen Stars
Sixteen Stars

Re: How to convert this sql case statement for tmap

Did this help?
If so, thank's to mark your case as solved.

TRF

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog