Alteryx Designer Desktop Discussions

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

Summarize and Transpose

LincolnMike
8 - Asteroid

Hello and good evening my Alteryx friends.  Happy post voting day!  I the following and I need some support

 

INPUT

unitstoreexpenseCdcost
123ab660rental100
123ab660other99
456cx790rental1200
456cx790other68
456cx790add1000

 

 

I need the following Output.  One row for the unit, displaying as many expense codes listed (usually no more than 6), and summarize the cost.

unitstoreexpenseCd1expenseCd2expenseCd3CostSummary
123ab660rentalother 199
456cx790rentalotheradd2268

 

Your help is most appreciated.  

3 REPLIES 3
LincolnMike
8 - Asteroid

attached is a YXMD with the table

jdunkerley79
ACE Emeritus
ACE Emeritus

I would do this in 2 parts.

 

2018-11-08_07-38-51.png

 

1. Create a record id group by unit and store. Use this to perform the cross-tab

2. Create the cost summary totals

 

Finally join back together

 

 

LincolnMike
8 - Asteroid

thank you JD!  I initially tried David's on my smaller population and the answer was as expected, but after I applied it to my million records it came up with 17 columns of Expense codes.  I did not realize I would have 17 different codes, otherwise I would have asked for a different remedy.

You solution fits the bill, but I will keep David's in my back pocket for other queries.

 

Thanks again JD and David.

 

Mike

Labels