if/Else condition and switch case in TOS

Highlighted
Five Stars

if/Else condition and switch case in TOS

How to implement following SQL Statement in TOS using TMAP (using IF else or switch)

Case
When T1.last_time between @gone_start_int and @gone_end_int Then 'Goneaway'
When T1.last_time between @lpd_start_int and @lpd_end_int Then 'Lapsed'
When T1.first_time between @start_date_int and @end_date_int Then 'New' --New customers
Else 'RFV' --active customers
End as 'RFM_Segment'

Sixteen Stars TRF
Sixteen Stars

Re: if/Else condition and switch case in TOS

If you want to use if/else, tJavaRow component is what you need. Within tMap you case use ternary notation.

TRF

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog