Goal: Join two flat files that include date strings into one file.
High-level Task: Perform a join between SKUSales_Quantity.csv and SKUSales_Revenue.csv. Join on the "SKU" field and a date field. Then join that output against SKUDescr.csv on "SKU". Export to flat file.
Detailed Task:
- Create a new flow.
- Add a
Flat Filesource node to the canvas. Open theSKUSales_Quantity.csvfile. - Under the
Data Type Assignmenttab, make sure the "SKU" field is the String data type, as well as any date fields (Date, Day, Month, Year). - Repeat step 2 and 3 for the
SKUSales_Revenue.csvandSKUDescr.csvfiles. - Add a
Derivenode to the canvas. Attach theSKUSales_Quantityflat file source node to it. - Configure the Derive node with the following script to take the 3 source date fields (Day, Month, Year) and output a single Date field.
tmp = row.get('Year') + "-" + row.get('Month') + "-" + row.get('Day');tmp; - Add a
Filternode to the canvas. Remove the Day, Month and Year fields from the output. Rename the derived date field to "Date". - Add a join node to the canvas, and attach the two brances that begin with the
SKUSales_Quantity.csvandSKUSales_Revenue.csvnodes. - Configure the
Joinnode to join on the "SKU" and "Date" fields. - Repeat steps 8 and 9 for the Join node from the previous step, and the
SKUDescr.csvnode. - Attach this node to a
Flat Fileexport node. Configure to export to `JoinOutput.csv'.