How do I implement this logic in tmap?

Highlighted
Five Stars

How do I implement this logic in tmap?

CASE WHEN WMS_NAME_ADDR_TYPE_1_00 = 3 THEN TRIM(WMS_CITY_STATE_1_00) + " " + TRIM(WMS_NA_ZIP_CODE_1_00) ELSE WMS_NAME_ADDRESS_1_00

 

I have tables named WMS_NAME_ADDR_TYPE_1_00

                                 WMS_CITY_STATE_1_00

                                 WMS_NA_ZIP_CODE_1_00

                                 WMS_NAME_ADDRESS_1_00

For now I have it as a straight map since I have no idea how to implement this logic: 

name_address.PNGI have the logic changed to tmap logic: 

WMS_NAME_ADDRESS_TYPE_1_00==3?TRIM(WMS_CITY_STATE_1_01)+ " " + TRIM(WMS_NA_ZIP_CODE_1_00): WMS_NAME_ADDRESS_1_00

 

Did I convert the logic correctly, and where exactly do I put this logic since it's using multiple tables and I have a straight map? 

Employee

Re: How do I implement this logic in tmap?

Hi,

 

   This looks fine. Since you are doing concatenation operation, I would suggest the null values for WMS_CITY_STATE_1_00 and WMS_NA_ZIP_CODE_1_00 as empty string (using interim Var variables in tMap) before doing concatenation. Else you would get null value in output even if one of the variable is having null.

 

Warm Regards,

 

Nikhil Thampi

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog