Alteryx Designer Desktop Discussions

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

Assign Region based on values in another field

arnettmh
7 - Meteor

Our company has sales people in the field that might have sales in various Regions.  I want to assign the Region based on Region that has the greatest number of sales for that particular salesperson.

 

For example, in the table below, I would want all of Salesperson A's sales assigned to the South Region, even though he has some sales in other Regions since he had the greatest number of sales in the South Region:

 

SalespersonRegionSales Amount
Salesperson ASouth1,000
Salesperson BSouth50
Salesperson AWest12
Salesperson ACentral55
Salesperson AEast25
Salesperson BCentral52

 

What kind of workflow could I use to come up with this?

 

Also, in the event of a tie between 2 Regions, I have a table that has a Rank on it that would then determine which Region would be used. I would also need this to be part of the workflow.

 

I am still relatively new to Alteryx and would appreciate any help given.

 

Thanks all!

7 REPLIES 7
oly
Alteryx Alumni (Retired)

Hi @arnettmh,

Check attached workflow. Not sure if you wanted maximum or minimum ranking value as priority, I used the minimum. Hope the logic is very straighforward, just combination of joins and summarize tools.

 

Best,

Ooy

arnettmh
7 - Meteor

Thanks for the really quick response.  Unfortunately, I am unable to open the file as I am on an older version of Alteryx (2021.1).  Are you able to screenshot the workflow?

arnettmh
7 - Meteor

I was able to open the file now.  I feel like this "almost" gives me the solution I need and I really appreciate your help.  However, in the final output, I would need the Region with the most sales applied to that salesperson and their total sales summed up for that Region.

 

For example, using the sample numbers above, the final output would have Salesperson A assigned to the South region since that is the Region that had the largest sales amount and the total sales amount for Salesperson A would be 1,092.  For Salesperson B, they would be assigned to the Central Region since they had the most sales in that Region (52).

 

So, the final output would look like the following:

 

SalespersonRegionSales Total
Salesperson ASouth1,092
Salesperson BCentral102
DataNath
17 - Castor

How does this look @arnettmh? Have increased one of the sales values (Salesperson A - West) to match another (South) to show it working with the rank table as well:

 

DataNath_0-1656345898514.png

DataNath_1-1656345919792.pngDataNath_2-1656345930388.png

 

arnettmh
7 - Meteor

 

This is awesome!  I like the approach.  What if I wanted to keep the original Region data (field named Region would become "Original Region") and add another column called (Max Amount Region), how would I do that?  Output would look like the below:

 

 

SalespersonOriginal RegionMax Amount RegionSales Amount
Salesperson ASouthSouth1,000
Salesperson BSouthCentral50
Salesperson AWestSouth12
Salesperson ACentralSouth55
Salesperson AEastSouth25
Salesperson BCentralCentral52
DataNath
17 - Castor

@arnettmh just add another join like so :) If you don't want the 'Sales Total' field in the output then simply untick it in the Join tool configuration:

 

DataNath_0-1656354266637.png

 

arnettmh
7 - Meteor

Thanks for all the assistance!

Labels