Sawtooth Software: The Survey Software of Choice

Reference drop-down value of highest value row in a grid

I have a grid question where the first column has a drop-down and the second column has a numeric input. I want to reference the drop-down value based on whichever row has the highest input in the numeric column.

Probably the most straightforward way to do this would be some Unverified Perl. Assume the grid question is called Q2, with column 1 being a drop-down select and column 2 being a numeric input (question direction is set to columns). Step 1 is to figure out which row contains the highest value from the numeric input.


The above code in a constructed list will add the row labels in order from greatest to least. Now we can use a function like ListValue(ConstructedListName,1) to give us the row index of the row that has the highest value.

To then reference that column, we could use the following Perl:

VALUE("q2_r" . LISTVALUE("SortedList",1) . "_c1")

This code would concatenate down to VALUE("q2_r#_c1"), where r# becomes the row with the highest value from the second column.

Sawtooth Software

6:30 AM to 5:30 PM Mountain Time
(GMT-6; GMT-7 Autumn/Winter)
Monday through Friday

Phone: +1 801 477 4700
Fax: +1 801 337 7410

We are open!

SKIM Software

9:00 AM to 5:30 PM Central European
(GMT+2; GMT+1 Autumn/Winter)
Monday through Friday

Phone: +31 10 282 3500
Fax: +31 10 282 3560

Lighthouse Studio

Lighthouse Studio is our flagship software for producing and analyzing online and offline surveys. It contains modules for general interviewing, choice-based conjoint, adaptive choice-based conjoint, adaptive choice analysis, choice-value analysis, and maxdiff exercises.

Try Lighthouse Studio

  Buy Lighthouse Studio