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


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.