Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Spell out Column Name which has the min and max number in the same Row

Oct 14, 2020 1:46 PM
(210 views)

Hi,

Pls help me on generating a new column formula for calling out the Column Names which has the min and max number in the same row.

From this

to this

5 REPLIES 5

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Spell out Column Name which has the min and max number in the same Row

This column formula should work quite generally. It's independent of column names. However, it assumes the data columns are in a sequence and the column number of the start and end columns must be set (as local variables).

Get name of column with max value:

```
Local( {start = 2, end = 7, L = Current Data Table()[Row(), start :: end]},
Column( Loc Max( L ) + start - 1 ) << get name
);
```

And for min:

```
Local( {start = 2, end = 7, L = Current Data Table()[Row(), start :: end]},
Column( Loc Min( L ) + start - 1 ) << get name
);
```

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Spell out Column Name which has the min and max number in the same Row

Hi Ms Super User -

I tried it but not working. I found it in Excel formula, but not sure how to convert it to Jmp. As per in this screenshot

**=INDEX($B$1:$F$1,0,MATCH(MAX($B2:$F2),$B2:$F2,0))**

Highlighted
##

What version of JMP do you use? The formula I posted utilize data table matrix notation, a feature I think came with JMP 13.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Spell out Column Name which has the min and max number in the same Row

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Spell out Column Name which has the min and max number in the same Row

Hi MS SUPER USER,

I figure it out to get it work. Thanks. Jmp14.

It looks like we can only make it work when it's treated as local columns. Is there a way to name them by the original column name, instead of column numbering? The reason I am asking, if someone added/appended some columns in the data table, the column numbering may not work properly.

Highlighted
##

How would you do this if the data columns sequence are not in order? Is there a way to do this by giving column names of interest and then generating a column that shows the max/min column name?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Spell out Column Name which has the min and max number in the same Row