We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Merge data from rows

cutehappybear
7 - Meteor

Hello,

 

I am having a hard time figuring out how to merge specific rows into one, while leaving the remaining rows as they are.

My table looks like this:

IDFieldValue
123GameToyStory
123AnimalDog
123AnimalCat
123AnimalHorse
123FlowerTulip
4567FlowerMargarida
4567AnimalHorse
4567AnimalTiger

 

And I want to turn it into:

IDFieldValue
123GameToyStory
123AnimalDog, Cat, Horse
123FlowerTulip
4567FlowerMargarida
4567AnimalHorse, Tiger

 

Basically I want to merge only the rows in which the Field is Animal, and I want to concatenate the data using commas. While leaving all the other rows as they are. But I only want to merge those who belong to the same ID. Any ideas on how to proceed?

2 REPLIES 2
binuacs
21 - Polaris
AngelosPachis
16 - Nebula

Hi @cutehappybear ,

 

You can filter out the records that contain "Animal" under the [Field] column and then feed that to a summarize tool, configured to group by ID and Field and concatenate the field [Value]. Then you can union that back to your dataset and you are good to go.

 

AngelosPachis_0-1643835888434.png

( If you want to maintain the sort order, then you can add a record ID before the filter tool and use that to grab the first record ID for each ID and animal type combo and use that after your union to sort on)

 

Hope that helps,

Angelos

Labels
Top Solution Authors