I have four formula type questions
in a LimeSurvey were the resultants are integers
e.g
Q-1=23 Q-4=19 Q-7=45 Q-9=24
I need to find the greatest number and its related question #
In this case the greatest # is 45
and the question # is Q-7
I have been reading the Expression Manager
documentation but am having no luck
Thank you
Well, if you have hyphens in your question codes you must be using an outdated version of LimeSurvey. This solution is for the current version (2.05) and assumes that there cannot be duplicates in the formula questions...
For the sake of simplicity, lets give your formula questions codes q1, q2, q3 and q4.
Create a new "Equation" type question (let's call it "maxVal") with this equation.
{max(q1, q2, q3, q4)}
Then you can use nested IFs to display the highest formula question code (line-breaks inserted for clarity):
{if(q1 == maxVal, 'q1',
if(q2 == maxVal, 'q2',
if(q3 == maxVal, 'q3',
if(q4 == maxVal, 'q4',
''
))))}