Thank's Jeremy for publishing this tutorial. Just a trick to add: let's say in this example we want to build a unique list of keys by combining Data1, Data2 and removing Data3 keys. This can be easily done with the following groovy code:
data['data_list_out']=(data['Data1_list']+data['Data2_list']-data['Data3_list']).toString()
// removing null values, deduping, sorting
data['data_list_out']=((data['Data1_list']+data['Data2_list']-data['Data3_list'])-null).unique().sort().toString()
------------------------------
Eric Hubert
PreSales Engineer
Pitney Bowes Software France SAS
Levallois Perret
------------------------------
Original Message:
Sent: 10-08-2019 15:30
From: Jeremy Peters
Subject: Concatenate All String Values into a Comma Separated List for a Specified Field in a Group in a Spectrum Dataflow
In SCV implementations we often update a Best of Breed customer record with the best values from all matching records representing the same customer in order to implement consolidation survivorship rules. We typically do this using the Spectrum Best of Breed stage by defining rules and actions to copy values from individual matching records to the Best of Breed Master record. However, sometimes we want to update a field in the Best of Breed record with a delimited list of all unique values from matching customer records as part of consolidation survivorship rules. One typical example of this, is the need to show IDs, such as the source system customer ids from each original record in the one Best of Breed Master record. We can do this by using the Spectrum Aggregator stage to convert flat data to hierarchical data listing all values for each group and then removing duplicate values and flattening the values into a string variable. Attached is a SCV Advanced Topic 'How To' Short Training Video on how to so this.
------------------------------
Jeremy Peters: GISP, CIMP - Master Data Management & Data Quality
Solutions Architect / Principal Consultant/ Distinguished Engineer
Pitney Bowes Customer Information Management and Location Intelligence
350 Jordan Rd | Troy, NY 12180 USA
jeremy.peters@pb.com
https://www.linkedin.com/in/jeremypeters1/
------------------------------