Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Max value of string fields based on integer field

JPri
5 - Atom

I am trying to return the max string value in a dataset where location may be different, but each line is part of same group. I would like to return the location that has incurred the most amount, compared to total.

 

For example, below would be like the data I have to manipulate and the smaller box is what I would like it to return. So, they are all part of group A, but because USA has amount of 200 out of 300, this should return as max country (same logic applied to 'Type'), but the total amount for A would be 300. 

 

Can anyone help to figure this out? 

 

Data:   
GroupCountrySubjectAmount
AUSARobotics100
AFranceRobotics100
AUSAMedia100
    
Trying to achieve:  
GroupMax of CountryMax of TypeAmount
AUSARobotics300

 

 

Also, is there a filter that I can apply that would show all countries without duplicating any of them: 

 

GroupCountries involvedMax of TypeAmount
AUSA, FranceRobotics300
3 REPLIES 3
Kenda
16 - Nebula
16 - Nebula

Hey @JPri!

 

See if the attached workflow gets you the output you're looking for.

 

The left Browse should be your first request with the Max Country, the Max Subject, and the grand total. The right Browse will return your second request with all countries involved with the Max Subject along with the grand total amount. 

 

Hope this helps!

 

Capture.PNG

ponraj
13 - Pulsar

Here is the sample workflow for your case.  Hope this is helpful. 

 

WorkflowWorkflowInputInputResultsResults

JPri
5 - Atom

Thanks both!

Labels
Top Solution Authors