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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
pravakarc
Contributor
Contributor

Divide 10 in ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) Talend

Hi Team, I want to divide 10 in ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) record count and split 10 files in the tFileOutputDelimited output

Labels (2)
1 Reply
Anonymous
Not applicable

Hi

The global variable ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) can be only used in next subjob, you can't used it directly in the current subjob, so I suggest you to use tFileRowCount to get the number of total rows of file first, and calculate the number of rows of each file if you need to split the output to several files. eg:

tFileRowCount_1

|onsubjobok

tJava

|onsubjobok

tFileInputDelimited--main-->tFileOutputDelimited

 

on tJava:'

int total_nb_line=((Integer)globalMap.get("tFileRowCount_1_COUNT"));

int each_file_rows=total_nb_line/10+1;

globalMap.put("keyName",each_file_rows);

 

In the advanced settings panel of tFileOutputDelimited, check the 'Split output in several files' and set the parameter of Rows in each output file as:

(Integer)globalMap.get("keyName")

 

Hope it helps you!

 

Regards

Shong