We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Identifying the Final Segmentation of a Company from Multi-Segment Accounts

Mwatts23
8 - Asteroid

Hi Everyone,

 

I would like to ask your help about getting the final segmentation of a company which has multiple segments and with different scenarios.

Below is the ss of the raw data and the expected result. Attached is the excel file that contains the data and the explanation of each company scenarios.

For any clarifications, please let me know. Thank you.

 

Mwatts23_1-1753270530458.png

 

Mwatts23_2-1753270571666.png

 

*Segmentation Hierarchy 
1Shoes
2Apparel
3Slippers
4Cap

 

How to identify the Final Segmentation per scenario 
NikeIf a Company has 2 Shoes and 2 Apparel then the final Segmentation is Shoes since in the Segmentation Hierarchy Shoes is on top of the hierarchy
AdidasIf a Company has 1 Shoes and 1 Apparel then the final Segmentation is Shoes since in the Segmentation Hierarchy Shoes is a much higher hierarchy
ReebokIf a Company has 1 Cap, 1 Apparel and 1 Slippers then the final Segmentation is Apparel since in the Segmentation Hierarchy Apparel is a much higher hierarchy among the 3
UnderarmorIf a Company has 1 Shoes and 2 Slippers then the final Segmentation is Slippers since MAJORITY of the Segmentation is Slippers
World BalanceIf only 1 segmentation then stays as is
JD SportsFor no segmentation then stays as null
7 REPLIES 7
aatalai
15 - Aurora

@Mwatts23 I concatnated the segments grouping by company then using an If statement going down the hierarchy to update the final segmentation than joined it back up

 

hope it helps, let me know how you get on

 

Screenshot 2025-07-23 134319.png

Pilsner
13 - Pulsar

Hello @Mwatts23 

I would begin by joining your input raw data table to your hierarchy table. This allows you to see which hierarchy (or rank) each of the segmentations gets

1.png


After this, you can sort the ranks ascending and sample the top record per company to identify the Final Segment per company.

 

2.png


Finally, you need to join this table back to your original data, based on the company field (use the union tool to make sure no unjoined records are excluded).

3.png


I've attached the workflow below. I hope this helps but if you have any questions please let me know.

Regards - Pilsner




Mwatts23
8 - Asteroid

Hi @aatalai,

 

Thank you for your reply. The result looks good!

However, Underarmor's final segmentation should be Slippers instead of shoes. Even though shoes is the top of the hierarchy but majority of Underarmor's segmentation will be followed, thus Slippers becomes the final Segmentation.

Mwatts23_1-1753333327583.png

 

Regards,

Mike

Mwatts23
8 - Asteroid

Hi @Pilsner,

 

Cool! Thank you for taking your time on my inquiry.

However, Underarmor's final segmentation should be Slippers instead of shoes. Even though shoes is the top of the hierarchy but majority of Underarmor's segmentation will be followed, thus Slippers becomes the final Segmentation.

I can't get around on this particular issue.

Mwatts23_2-1753333383286.png

 

 

Regards,

Mike

Pilsner
13 - Pulsar

Hello @Mwatts23 

Great spot, I missed this first time round. To get this to work as expected, all you should need to do is make two changes to the original workflow. 

Firstly, add a summarise tool in between the main input and the join tool. The summarise tool should be set to group by company and segmentation, and count on segmentation.

sum.png



Finally, you need to add this new count column to the sort tool (and sort descending), making sure that the count column appears first in your sort list.

sort.png




This should get you the following results.

browse.png

  



I've updated the workflow and re-attached it below.

Please let me know if this helps/ you have any questions.

Regards - Pilsner

Mwatts23
8 - Asteroid

Awesome @Pilsner! It works perfectly! Thank you.

 

Pilsner
13 - Pulsar

Glad to hear, thanks @Mwatts23!

Labels
Top Solution Authors