Alteryx Designer Desktop Discussions

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

Finding the minimum value across multiple columns

jakechan
5 - Atom

Hello 

 

I'm new to alteryx and I'm hoping there's a simple answer to this 

 

I want to find the minimum value across a row, for example 

 

 Col 1Col 2Col 3Col 4Col 5Col 6Col 7Col 8Col 9Col 10Minimum Value
A1  3 4  4 1
B  22       22
C     3 2  2
D   22    3 3
E       2  2
F   3  3   3
G     2  2 2
H   3     333

 

And I want to create that last minimum value column in alteryx.

 

One way I could do this is with a formula MIN(Col 1 + Col 2 etc..), however I have too many columns to individually type out. Is there another way I can do this? Or more broadly, how can I write a formula that say "from Col X to Col Y". The excel version would be MIN(Col 1:Col 10)

 

Thank you! 

14 REPLIES 14
Soraju
7 - Meteor

Thank you for the solution. It worked for my workflow as well. I am needing to go a step ahead here and display the column header too. For example record ID 1 has a minimum value of 1 and thats coming from col 1. Is there a way I could display Col 1 in my result too. ?

 

something like this : 

Soraju_0-1677095881432.png

 

Dazzerman
11 - Bolide

Hi Soraju,

 

I have attached a workflow that achieves what you want.

 

Bear in mind that you can (and do in this example) get multiple columns that have the same minimum value, so in this case those multiple answers are concatenated into the Min_Columns column.

 

Jakechan_query_Soraju.png

Soraju
7 - Meteor

Thank you very much for your help. It worked perfectly fine.

Soraju
7 - Meteor

Do you know if I could pick a the second maximum cost. Example in the image you've shown, the record ID 1 or row 1 has a max value of 4. I want to pick the one thats lesser than max. So looking at picking value 3 from Col4.

Dazzerman
11 - Bolide

Hi Soraju,

 

There is almost always a way to do what you want with Alteryx!!

:-)

 

You didn't say what you wanted to do if there wasn't a value that matches your requirement so I have assumed that you don't want to return a value if there is no match.

 

For example, I have added a "Select" column to the data that, in this case, is all set to "2" so the second highest unique value is returned for each row, if there is a second highest value.  See results :

 

Jakechan_query_Soraju2.png

Again, a workflow is attached that you can adapt your your more specific needs.

 

Hope this helps!

 

Cheers!

 

Labels
Top Solution Authors