- Posts: 10216
- Thank you received: 3635
Ask the community, share ideas, and connect with other LimeSurvey users!
But I still want to know how to rank the results of the 4 arrays & deliver a different text output depending on the highest storing section.
{sum(that.q1.value)}
{max(sum(that.q1.value), sum(that.q2.value), sum(that.q3.value), sum(that.q4.value))}
{if(q1 == maxVal, 'Text if q1 highest', if(q2 == maxVal, 'Text if q2 highest', if(q3 == maxVal, 'Text if q3 highest', if(q4 == maxVal, 'Text if q4 highest', '' ))))}
{if(q1 == maxVal, 'Text if q1 highest', if(q2 == maxVal, 'Text if q2 highest', if(q3 == maxVal, 'Text if q3 highest', if(q4 == maxVal, 'Text if q4 highest', if(q1 == maxVal AND q2 == maxVal, 'You are equally suited to Q1 and Q2', if(q1 == maxVal AND q3 == maxVal, 'You are equally suited to Q1 and Q3', if(q1 == maxVal AND q4 == maxVal, 'You are equally suited to Q1 and Q4', if(q2 == maxVal AND q3 == maxVal, 'You are equally suited to Q2 and Q3', if(q2 == maxVal AND q4 == maxVal, 'You are equally suited to Q2 and Q4', if(q3 == maxVal AND q4 == maxVal, 'You are equally suited to Q3 and Q4', '' ))))))))))}