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

Alteryx Designer Desktop Discussions

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

Function Help

tanishmittal
7 - Meteor

I have the following data in alteryx.

 

NameCategory%Output
AXX25%YY
AYY75%YY
BXX40%XX
BYY20%XX
BZZ15%XX
BQQ25%XX
CZZ20%General
CXX40%General
CYY40%General
DYY100% 
EQQ50% 
EZZ50% 

 

I want the output to be the category column based on maximum value of % in a name. For example - For B, 40% is maximum, hence output is XX which corresponds to 40%


However, if the maximum % is same of two categories, I want it to be tagged as "General". For example: in C, the max % is 40% of XX and YY, hence tagging is "General"

 

Please help, thanks!

4 REPLIES 4
T_Willins
14 - Magnetar
14 - Magnetar

Hi @tanishmittal,

 

Attached is a workflow that meets your criteria.  The workflow finds the maximum value by Name, then Joins to find the Categories that match that Name and Value.  Then second Summarize tool groups again by Name and concatenates all matching Categories, separating values by a pipe.  The Formula tool finds any concatenated values (pipe) and changes them to "General".  Then the results are Joined back with the original data.

 

IFS.jpg

 

Emil_Kos
17 - Castor
17 - Castor

Hi @T_Willins,

 

This is a very elegant solution. Thank you for sharing!

tanishmittal
7 - Meteor

Thanks @T_Willins, this works brilliantly. 

 

Side note for other using this solution: Concatenate also yields "," instead of "/" at times, so make sure you check the same in your database. Thanks!

T_Willins
14 - Magnetar
14 - Magnetar

Hi @tanishmittal,

 

You can select the concatenate separator in the Summarize tool.  For simple concatenations I usually select the pipe instead of the comma as the pipe is not commonly used outside of as an OR command in codes.

Labels