simple job.. create output excel.. with dynamic sheet name with context

Six Stars

simple job.. create output excel.. with dynamic sheet name with context

can not assign context variable to sheet name


Accepted Solutions
Community Manager

Re: simple job.. create output excel.. with dynamic sheet name with context

OK, that is not going to work. Your tMap variables work on a basis of an expression assigned to the variable name. You cannot assign a value inside the expression (unless you are using a routine). Try using a tJavaFlex to assign the context variable like that. 

 

But another very important thing to keep in mind is that file input and output components are intialized when the SubJob starts. So your context variable value MUST be assigned before the SubJob with the Excel file component is started.

 

So, create a SubJob to assign your context variable then join that SubJob to another SubJob (using OnSubJobOk) where the file is written to.


All Replies
Community Manager

Re: simple job.. create output excel.. with dynamic sheet name with context

OK, that is not going to work. Your tMap variables work on a basis of an expression assigned to the variable name. You cannot assign a value inside the expression (unless you are using a routine). Try using a tJavaFlex to assign the context variable like that. 

 

But another very important thing to keep in mind is that file input and output components are intialized when the SubJob starts. So your context variable value MUST be assigned before the SubJob with the Excel file component is started.

 

So, create a SubJob to assign your context variable then join that SubJob to another SubJob (using OnSubJobOk) where the file is written to.

Highlighted
Six Stars

Re: simple job.. create output excel.. with dynamic sheet name with context

learnt most important thing today...  

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog