Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating global variable from external file

Hi All,

I am new to talend. I am trying to find out the way to create global variables automatically from the external file.

If anyone has already faced this scenario.

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Suppose you have a CSV file with fields key and value. Connect a tFileInputDelimited to a tSetGlobalVar. Add Aline into the variable array and enter row1.key for the key field and row1.value for the value.
When you will run that job, you have 1 variable for each input file record.

View solution in original post

6 Replies
TRF
Champion II
Champion II

Suppose you have a CSV file with fields key and value. Connect a tFileInputDelimited to a tSetGlobalVar. Add Aline into the variable array and enter row1.key for the key field and row1.value for the value.
When you will run that job, you have 1 variable for each input file record.
Anonymous
Not applicable
Author

Hello,

Could you please let us know if this scenario helps?

TalendHelpCenter:Reading data from different MySQL databases using dynamically loaded connection par...

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabrina , Thanks for your quick reply. I went through the link but there contextload is being used to export the variable but in my case I am not able to use contextload because I am not able to access context varibale in RUN IF trigger link, but global variables are accessible there, so I am going with global variables. 

TRF
Champion II
Champion II

tContextLoad should work if you want to load context variables - don't know why you can't use a context variable in a If trigger expression.

However, as you were asking for a solution for global variables, my previous answer should help you.

martel
Creator
Creator

i have a job todo this , and run prejob on all job for initialization (cf screens)
2019-01-09_09-28-24.jpg
2019-01-09_09-27-37.jpg
2019-01-09_09-26-33.jpg
Anonymous
Not applicable
Author

Thanks All for the help, TRF's solution worked out as I am using global variable. I will explore contextload as well, why I am not able to access context variable in run if trigger.