cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
BHarris
Level VII

Finding 3 largest values out of a set

I need to identify the 3 largest values out of a set of data grouping by certain columns, e.g. with Big Class, suppose I want to identify the 3 tallest students at each age for each sex.  I don't think there are any ties/ambiguity in that set, but in my set there are, e.g. if the heights for a given age/sex combination were (64, 63, 61, 61, 61, 61), it doesn't matter which of the 61s is selected.

 

Is there a formula I could use in a column that would return 1 for these identified students and 0 for the rest?

 

I imagine there's a way to do it with .jsl loops, but I'm hoping there's a formula that will do this.

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Finding 3 largest values out of a set

You can use formula for this. Sometimes just Col Rank() is enough but sometimes you should combine it with Col Number(). After that use simple comparison to get 1 or 0 value

1 + Col Number(:height, :age, :sex) - Col Rank(:height, :age, :sex) < 4
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Finding 3 largest values out of a set

You can use formula for this. Sometimes just Col Rank() is enough but sometimes you should combine it with Col Number(). After that use simple comparison to get 1 or 0 value

1 + Col Number(:height, :age, :sex) - Col Rank(:height, :age, :sex) < 4
-Jarmo
BHarris
Level VII

Re: Finding 3 largest values out of a set

Works perfectly, exactly what I needed.  Thanks @jthi!

Recommended Articles