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.
Assumptions:
- 4 Arrays with question codes q1, q2, q3 and q4
- You do not expect any of the array assessment totals to equal another array assessment total
This will give you the "total assessment value" for an array, question code
q1:
Code:
{sum(that.q1.value)}
So, then you could create a new "Equation" type question (let's call it "maxVal") with the following equation. This will give the highest "total assessment value".
Code:
{max(sum(that.q1.value), sum(that.q2.value), sum(that.q3.value), sum(that.q4.value))}
Then you can use nested IFs to display variable text depending on which array matches the highest "total assessment value" (line-breaks inserted for clarity):
Code:
{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',
''
))))}