Split one table into several tables by value

Four Stars

Split one table into several tables by value

Hello to all,

I want to build several tables dynamically out of one big source table by one field value.

 

The source is like this:

YEAR    MONTH    col3    col4 ...... (a lot of colums)

2016        4             123    abc

2017        7             321    cba

....

 

now I want all rows from year 2016 in a new table named like 'source_2016' and another new table 'source_2017' with all the rows where year = 2017 and so on. 

Is there a way to realize this so it will work automatically also if any new years will be added? 

 

Thank you in advance


Accepted Solutions
Eleven Stars

Re: Split one table into several tables by value

try this 

 

http://talendhowto.com/2017/10/27/how-to-split-file-depending-on-column-values-2/

 

it is for files but same should work for logic should work for Tables.

Regards
Abhishek KUMAR

All Replies
Eleven Stars

Re: Split one table into several tables by value

try this 

 

http://talendhowto.com/2017/10/27/how-to-split-file-depending-on-column-values-2/

 

it is for files but same should work for logic should work for Tables.

Regards
Abhishek KUMAR
Four Stars

Re: Split one table into several tables by value

Thank you very much. I adapted that and it works perfectly.

 

However, is there a way to fill in the value fields in tfixedflowinput automatically with the globalMap values because in my case there are about 100 columns to fill? I could not find a way to simply take over all the input fields to output value

 

Kind regards

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog