Turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- I need to compare several columns

Topic Options

- Start Article
- 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
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 8, 2019 9:47 AM
(209 views)

Hi.

I have a table with several columns with values that represent total votes obtained by political parties. I need a script that finds the greatest values of these columns and obtains the name of the column, i.e. the political party.

Thanks in advance for your help.

Manel

1 ACCEPTED SOLUTION

Accepted Solutions

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

You can do this with the Formula Editor.

Use the Maximum() function to find the max value in the columns and then the Match() function to match it to which column it came from.

The attached data table has the example.

-Jeff

3 REPLIES 3

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

You can do this with the Formula Editor.

Use the Maximum() function to find the max value in the columns and then the Match() function to match it to which column it came from.

The attached data table has the example.

-Jeff

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

Re: I need to compare several columns

Thanks a lot Jeff,

I have a question.

How to do the second part of the formula?

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

Re: I need to compare several columns

The Match() function is under the Conditionals section of the Formula Editor.

With the Maximum() funtion built and selected in the Editor, click on Conditionals -> Match. You'll be prompted about adding arguments, select "Do Not Add".

Then click on the ^ button in the toolbar to add the four pairs of arguments and then fill them in.

-Jeff