Alteryx Designer Desktop Discussions

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

Pick the largest of a set of items

Erick_Reyes101
5 - Atom

Hello,

 

I would like to take the following data:

 

SKUanatomy2 Sum_sales 
@804-03-021KNEE                  323
@804-03-021SHOULDER              2,040
@506-03-138SHOULDER          154,922
@506-03-138KNEE                  523
@520-50-220SHOULDER          317,531
@520-50-220KNEE                  900

 

and take the largest sales value and use it to determine which anatomy should be used for the SKU:

 

SKUanatomy2
@804-03-021SHOULDER
@506-03-138SHOULDER
@520-50-220SHOULDER
3 REPLIES 3
Prometheus
12 - Quasar

@Erick_Reyes101 The first thing I did was clean up the Sum_sales field. Because it has commas in it, it came in as a String with leading spaces. I used a Formula tool with this expression to trim and remove commas: Replace(Trim([ Sum_sales ]), ',', ''). After that, I used a Select tool to change the data type of Sum_sales to Int32, sorted descending on Sum_sales, then used the Sample tool to select First 1 why grouping on SKU. 

Trim Sum Sales.PNG

String to Int.PNG

SKU Output.PNG

binuacs
20 - Arcturus

@Erick_Reyes101 Another method

image.png

Erick_Reyes101
5 - Atom

thanks to you both! 

 

i think both would work for my problem, thanks for the help!

Labels