Similar to my prior post regarding the flattening of an XML, I now have a use case which involves flattening a csv file into single rows/records.
Using the attached csv input file, you can see that for a given Purchase Order, there are multiple rows. (The provider / source of the file breaks down the records within the purchase order by Header, Other, and Detail as per the “Record Type” attribute). documentDownloads20210707_0940_191689.csv (3.3 KB)
Since we don’t care about the record type attribute, we want to flatten the multiple rows into one, effectively making the ‘primary key’ the PO Number. This way all of the other details from the columns rolls up together.
I’ve attempted to use the previous project to flatten using ranks, matrix table, deduplicating rows… but I’m only ending up with 1 record whereas the source csv potentially has multiple (multiple PO #'s). See attached. flatten-csv.morph (14.5 KB)
Any other thoughts / suggestions as to how to parse the input csv and output to the desired single record(s) as noted above ?