Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a source table/file with thousands of records, each record belongs one specific department, and number of department may grow.
and the requirement is to generate one file for each department and load corresponding data into that file, like that need to create files at run time depends on the number of department coming from the source.
Ex:
empid,name,deptid
100,a,10
200,b,20
300,c,10
400,d,40
500,c,30
600,e,10
700,f,40
800,g,20
as of now there are 4 different department from source file, so need to create 4 files at run time
FileName: file_10.txt File_20.txt
empid,name,deptid empid,name,deptid
100,a,10 200,b,20
300,c,10 800,g,20
600,e,10
like that need to create, and what are the components are required to implements this
Thanks
tFileInputDelimited --> tFlowToIterate
|
(onSubjobOK)
|
tIterateToFlow --> tFileOutputDelimited
Use the following expression for the output filename :
"file_" + (Integer)globalMap.get("deptid") + ".txt"