Separate Values

Highlighted
Six Stars

Separate Values

Hi,

 

I'm working with a database and one column has three values 'A - 00000', 'F - 00000' and 'NC - 00000', I need separate each value to the others, it´s possible separate with tFilterRow or need other element to do it?.

 

Regards.

 

Highlighted
Eleven Stars

Re: Separate Values

If number of districts value is known and pre-sefine

You could you tmap and create 3 output for each diff value.
Regards
Abhishek KUMAR
Highlighted
Eight Stars

Re: Separate Values

Hi @AngelTrejo1208 ,

 

This is possible in both static and dynamic way.

 

If you have definite number of distinct value you can create those many flows from tMap and separate the flows using expression filters.

 

If number of distinct value is not known, please follow the below steps:

 

1. get the distinct value from the database as "select distinct colname from tabname"

2. connect tFlowToIterate to the DB output.

3. In tFlowToIterate -> iterate output -> connect the same DB again with full query like "select * from tabname where colname = '"+((String)globalMap.get("yourtFlowToIterateKey"))+"'"

4. This Output can be put into a file and each file name can have the suffix of your tFlowToIterateKey as <FileName>_"+((String)globalMap.get("yourtFlowToIterateKey"))+".txt

 

This way you can dynamically split into as many files as there are number of distinct value for your column.

 

Thanks and Regards,

Subhadip

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

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

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog