Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am new to talend.
How can i filter and export a table of data based on the date?
My table of data could look like this:
Date| ID | Value
03.13.2020|001|325
03.13.2020|043|421
03.13.2020|143|463
01.22.2020|643|452
01.22.2020|543|301
I want to export my set of data into multiple CSV-files based on the date.
So the output files should look like this:
CSV_1:
03.13.2020|001|325
03.13.2020|043|421
03.13.2020|143|463
CSV_2:
01.22.2020|643|452
01.22.2020|543|301
Thanks
You need to use a tFlowToIterate to break the data flow.
This will create 1 global variable per field.
Then you have to restart the data flow using a tFixedFlowInput with the same schema and fields populated from global variables.
This component may be connected to a tFileOutputDelimited with the file name based on the content of the "Date" global variable value.
The design should like this: tDBInput-->tFlowToIterate--(iterate)-->tFixedFlowInput-->tFileOutputDelimited.
The file name value should look like this: "what you want for the path" + ((String)globalMap.get("Date")) + ".csv"
You need to use a tFlowToIterate to break the data flow.
This will create 1 global variable per field.
Then you have to restart the data flow using a tFixedFlowInput with the same schema and fields populated from global variables.
This component may be connected to a tFileOutputDelimited with the file name based on the content of the "Date" global variable value.
The design should like this: tDBInput-->tFlowToIterate--(iterate)-->tFixedFlowInput-->tFileOutputDelimited.
The file name value should look like this: "what you want for the path" + ((String)globalMap.get("Date")) + ".csv"