Here a solution with only a few equations.
There is no full handling of ties.
1. eqMax1: Calculate the maximum of all values
2. eqB1: Join some representatives "A", "B", "C", with this value
3. eqMax2: Calculate the maximum of all values less then the first maximum
4. eqB2: Join some representatives "A", "B", "C", with this value
5. eqMax3: Calculate the maximum of all values less then the second maximum
6. eqB3: Join some representatives "A", "B", "C", with this value
7. eqResult: Join eqB1, eqB2, eqB3 and take the first three characters
Now there are two ways to display
1. Your idea:
1st Column: If the first character is "A", it is "case 1", else if the first character is "B", it is "case 2", and so on
{if(substr(eqResult,0,1)=="A","case 1",if(substr(eqResult,0,1)=="B","case 2",if(substr(eqResult,0,1)=="C","case 3",if(substr(eqResult,0,1)=="D","case 4","case 5"))))}
2nd colum: Use the second character of the string in eqResult "substr(eqResult,1,1)"
As you do not know which case will be in which column your analysis will be really hard. You will have to restructure your dataset that you get case 1 in clumn 1, case 2 in column 2, ...
This is shown here
2. Use the plugin "hideEmptycolumn"
[url]
gitlab.com/SondagesPro/QuestionSettingsType/hideEmptyColumn
[/url]
Create five columns in Q32 "case1", "case 2", "case 3", ...
Use this as x-scale subquestions
{if(strpos("#"+eqResult,"A")>0,"case 1","")}
{if(strpos("#"+eqResult,"B")>0,"case 2","")}
{if(strpos("#"+eqResult,"C")>0,"case 3","")}
...
Meaning: if eqResult contains "A" the column has a value ("case 1"). Otherwise it is empty - and is not displayed.
This hashtag at the start is used to get a minimum index of 1, as an index of "0" means "not found" - and "strpos" starts counting at "0".
This way you will get a well structured dataset.
Joffm