Select Multiple - maximum/minimum calculations?

991
3
07-14-2017 03:22 PM
CoryMcGregor
New Contributor
Hi,
I'm wondering if it's possible to use the Maximum and Minimum functions with select_multiple questions
I've got a series of answers with numerical equivalents, and I'd like to find the maximum or minimum value answer to use for future equations.
E.g. I want to find the minimum "size" chosen using the following questions:
TypeNameLabelCalculation
select_multiple size_listsizesAvailable Sizes
decimalminimum_sizeMinimum Available Sizemin(${sizes})
list_namenamelabel
size_list1Small
size_list2Medium
size_list3Large
The calculation I tried only works if one choice is selected:
min(${sizes})
I'm able to find the minimum with cascading if statements, but it's pretty tedious and depends on the order the values are written:
if(selected(${sizes},'1'),1,if(selected(${sizes},'2'),2,if(selected(${sizes},'3'),3,0)))
Is there a better way to accomplish this?
Thanks
0 Kudos
3 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Cory

Select_multiple (or select_one) questions do not support calculations of any type. So it is not possible to use min or max in the way that you outlined. We can get this added as an enhancement request though.

Thanks

John

CoryMcGregor
New Contributor

Hi John,

Thanks for your reply. I may not have been clear that I was using a decimal question for the actual calculation part. I've edited the question to make it easier to read.

However, the If statements will work for me, I was just hoping to find an easier way to use the answers from select_multiple for future calculations if possible.

Cheers!

Cory

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

HI Cory

Because the select_multiple actually returns a string, any alternative approach would require you extracting the numbers from the string (and then getting the min/max), and would still require a number of if statements to achieve what you are trying to do. So to answer your question - there is not an easier way to do this.

Thanks

John

0 Kudos