Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Consolidating multiple rows into one, with calculating/merging data in specific columns

CAROLINEB
5 - Atom

I have a source file that contains multiple rows of data for users based on dates.  I am hoping to combine rows with duplicate information into a single line. For the purposes of this data, a duplicate is when there is more than one row for the same user and same date.  The best way to assess whether a row is a duplicate would be to look at the combined ID and Date columns, for each row, using the attached samples as a guide.  Then, the consolidation piece would involve adding together numeric values in the Total Units, Regular Units, and Other Units columns, to produce the net value.  In the Other Unit Type column, it would combine the descriptions, where applicable, displaying one instance of each unique description, with a comma separation, when there is more than one unique description. It would display the single unique description when it is merging two or more rows that have one unique description and a blank(s).  For the other columns, the data should match and only display one occurrence in the row.

 

Please see highlighted rows 12-15, 91-92, 93-94 of the input file and compare with rows 12, 88, and 89 of the output file to see what I'm hoping to achieve.  Is there a relatively simple way to do this? I'm guessing not but I'm a novice user and haven't been able to find anything yet that addresses something similar in the discussion board.

 

Thank you!

2 REPLIES 2
ChrisTX
16 - Nebula
16 - Nebula

The attached workflow should point you in the right direction.

 

ChrisTX_0-1680022697000.png

 

 

Chris

CAROLINEB
5 - Atom

This works well! Thank you very much for helping me.

Labels
Top Solution Authors