Community Halloween is live until October 31st! Complete any 2 quick activities to earn the 2025 Community Halloween badge. Feeling brave? Check out the activities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Select with highest value

Sshasnk
8 - Asteroid

I have a dataset where I have different percentages and I have to pick:

1. If the column value is greater than 80 (which has an integer value). I have to pick the column which has a comment on it

 

For example:  First row t1 is 80% for that we have column comment_t1 and I have to pick the value from there

 

2. If no column value has greater than 80 I have picked the top 2 

 

For example: 2nd row has values 15 (t1)  and 8 (t2), It has columns for comment comment_t1 and comment_t2 So I have to pick both the values and put it in the comment column

 

3. If there is only one value then I have to select the comment column for that.

 

Example: row 3rd where t2 has value so pick the comment_t3 column

 

Note: If the t1/t2/t3/t4 column does not have any value but it has a comment in columns  Comment_t1/ Comment_t2/ Comment_t3/ Comment_t4 we don't have to consider it

Input:

IDdescriptiont1Comment_t1t2 Comment_t2t3 Comment_t3t4 Comment_t4
123apple80Alex2.0Shane  3Tim
123apple15Alex8Shane2Drake Tim
245mango Alex2Shane    
245mango        

 

Below is the sample output:

 

 

IDdescriptiont1Comment_t1t2 Comment_t2t3 Comment_t3t4 Comment_t4comment
123apple80Alex2.0Shane  3TimAlex
123apple15Alex8Shane2Drake TimAlex,Shane
245mango Alex2Shane    Shane
245mango        NA
0 REPLIES 0
Labels
Top Solution Authors