Naming the output based on a column value in Talend

0 votes

have a job in which I am using Database input component, tMap for processing and Excel output component to store the data. Now, I need to name this output file based on one of the values from the database table. To be more specific, I need to fetch the values from the column named “TYPE” with value “A1”. 

Please enlighten me how to perform this Job.

Apr 19, 2018 in Talend by v.liyyah
• 1,290 points
158 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can try to solve this problem by adding few more components to your job like tMysqlInput and a tSetGlobalVar component and setting up your job as shown:

image

Once done, go to the component tab of tMysqlInput_1 type the given query:

select TYPE from my_table limit 1;

In the tSetGlobalVar component, specify the key-value pair:

key = "file_name", value = (String)row1.type

Now, go to the tMysqlInput_1 and specify the input table and proceed to map the data.

In the “File Name” field of the tFileOutputExcel, specify the below expression to name it based on the output:

"C:\\Users\\XYZ\\"+((String)globalMap.get("file_name"))”

Note that this is not the only solution. There are n number of ways to achieve the same result. But among all, I feel this is the easiest one. Hope this helps!!

answered Apr 19, 2018 by 93.lynn
• 1,550 points

Related Questions In Talend

0 votes
2 answers
0 votes
1 answer

Specifying the number of Rows Processed in Talend

Hi, you can try using tSampleRow component ...READ MORE

answered Apr 14, 2018 in Talend by code.reaper12
• 3,450 points
44 views
0 votes
1 answer

Creating a New Project in Talend Open Studio

Before you switch over to a new ...READ MORE

answered Apr 18, 2018 in Talend by misc.edu04
• 1,380 points
139 views
0 votes
1 answer

How to generate multiple rows from a single row in Talend?

I think using tJavaFlex, tMap and tFlowToIterate ...READ MORE

answered Apr 18, 2018 in Talend by code.reaper12
• 3,450 points
692 views
0 votes
1 answer
0 votes
1 answer

Looping through all the schemas in Talend

It is really simple to make tOracleInput ...READ MORE

answered Apr 10, 2018 in Talend by code.reaper12
• 3,450 points
48 views
0 votes
1 answer

Adding third party libraries into the Talend project

You can add the 3rd party libraries ...READ MORE

answered Apr 9, 2018 in Talend by code.reaper12
• 3,450 points
199 views
0 votes
1 answer

tWaitForFile component insufficiency in Talend

Regarding your first issue, tWaitForFile component provides ...READ MORE

answered Apr 10, 2018 in Talend by geek.erkami
• 2,320 points
169 views
0 votes
1 answer

Downloading files using Talend Studio

As per my understanding, I think first ...READ MORE

answered Apr 11, 2018 in Talend by code.reaper12
• 3,450 points
144 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.