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

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

View solution in original post


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.

View solution in original post

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