Calling all Alteryx customers: Refer your colleague to try Alteryx and receive a $50 gift card. Sign up now!

Alteryx Designer Desktop Discussions

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

Find the second smallest number

laura_manescu
5 - Atom

Hello,

 

I am just starting in Alteryx and I need a bit of help. 

 

I have the enclosed file where I have a group of numbers per country and I need to find the 2nd smallest number per that specific country and put the department in a new column.

 

i.e. for the first line Country 1 I would need to show after Total column a new column where Department 3 is written as it's the 2nd smallest number after the 5 which is the minimum value.

 

Is there an easy way to do this? Many thanks and sorry if my question is simple.

 

Thanks a lot!

 

3 REPLIES 3
alexnajm
18 - Pollux
18 - Pollux

This sounds like a couple of Sample tools! But I am a little unclear on your expected output

OTrieger
13 - Pulsar

@laura_manescu 
You could use the Summarize Tool, Grouping on Country and Min number, Join these values with the rest of the data, now in the J you will have the rest of the values and in the R or L you will have the rest of the numbers, do the same again with another Summarize Tool  and you will have the 2nd smallest.

ThuNguyenPhuoc
5 - Atom

You can get any ordered number and its column name

 
 
Labels
Top Solution Authors