community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Summarize and Transpose

Highlighted
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.  

Asteroid

attached is a YXMD with the table

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

 

 

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