ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

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

Find and Highlight the Maximum value per each category of a field

PNiccolo
7 - Meteor

Hi everyone!

I currently have a table that looks like this:

PlantItemInventory Value

Plant A

Item X

10
Plant AItem Y12
Plant AItem Z11

Plant B

Item X

5
Plant BItem Y3
Plant CItem X4
Plant CItem Y5
Plant CItem Z7


What I would like to do is to create a tool to automatically highlight, or make somehow understand, which is the item with the maximum inventory value for each plant.

Do you know a way to do it?

Thanks a lot!

Thableaus
17 - Castor
17 - Castor

Hi @PNiccolo 

Group by Plant and use Max on the Inventory Value, with the Summarize Tool.

 

You can them join it back to your dataset by Plant and Inventory Value to get the Item, if you want.


Cheers,

Thableaus
17 - Castor
17 - Castor

@PNiccolo 

 

Another way of doing it would be using the Sort Tool + Sample Tool.

 

The Sort Tool would sort your Plant and Inventory values by Descending, then you could use the Sample Tool to get the 1st value grouping by Plant.

 

Cheers,  

Thableaus
17 - Castor
17 - Castor

@PNiccolo 

 

Both of ways to do this in the WF attached.

 

Max_Value.PNG

Amin
8 - Asteroid

Tested both approaches, works wonderfully.

 

Just a caution for the Sort Tool + Sample Tool approach:

When there is more than 1 maximum types (e.g. both apples are oranges are maximum for a fruit shop), only one will be reflected.

 

As such, I will prefer the Summarize and Join approach earlier by @Thableaus.

Labels