Summarize duplicates with combining rows and columns

Columns to rows, aggregates, and then rows to columns. Key functions: pivot and groups

Example

There is a csv file csv1.csv, as follows:

There is a csv file csv2.csv, as follows:

Now you need to merge these two tables by rows and columns, and at the same time summarize the duplicates, the results are as follows:

Write the SPL script:

A1 Read data from csv

A2 Read data from csv

A3 Column to row

A4 Column to row

A5 Summarize duplicates. When there are multiple sets of data, use conj to merge; here are two; just use | to merge

A6 The summarized result, row to column

A7 Export the result to result.csv

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store