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

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.