Hi,
first, what is wrong in your approach?
{if(Q12_1.NAOK=="Y",if(Q12_2.NAOK=="Y",if(Q12_3.NAOK=="Y",if(Q12_4.NAOK=="Y",if(Q12_6.NAOK=="Y",if(Q12_8.NAOK=="Y",if(Q12_9.NAOK=="Y","Comprador regular","")))))))}
Nearly correct, but you also get this result if the respondent selects Q12_1 and Q12_5 . You have to exclude the irregular items.
The second is analogue.
And here
{if(Q12_1.NAOK=="Y",if(Q12_2.NAOK=="Y",if(Q12_3.NAOK=="Y",if(Q12_4.NAOK=="Y",if(Q12_6.NAOK=="Y",if(Q12_8.NAOK=="Y",if(Q12_9.NAOK=="Y",if(Q12_7.NAOK=="Y","Comprador Omnicanal",""))))))))}
What about Q12_5?
And if the respondent selects Q12_1 he is both "regular" and "omnicanal". The rest of the nested IF is not taken onto account, after one condition is TRUE.
Now the solutions:
If you use the "that" variable it is really short
Read the manual about it
[url]
www.limesurvey.org/manual/ExpressionScri....22that.22_variables
[/url]
To be able to use it you should recode the items like
You see, the regular items start with "R", the irregular with "I"
Now you can say:
{if(count(that.Q12.sq_R)>0 AND count(that.Q12.sq_I)>0,"Comprador omnicanal",if(count(that.Q12.sq_R)>0,"Comprador regular","Comprador irregular"))}
Meaning:
You count the number of selected items where the code contains an "R" (count(that.Q12.sq_R) and
the number of selected items where the code contains an "I" (count(that.Q12.sq_I).
Now the first part of the nested IF
If both give a result greater 0, items of both categories have been selected --> omnicanal
Second part:
ELSE (not both greater 0)
if the number of "R" items is greater 0 --> regular
ELSE (not both greater 0, not "R" greater 0)
it is irregular.
Here you see, how this construct with the "that" variable is expanded
So without the recoding of your items you also can write the equation like this, the long version
{if(count(Q12_1, Q12_2, Q12_3, Q12_4, Q12_6, Q12_8, Q12_9) > 0 AND count(Q12_5, Q12_7) > 0, "Comprador omnichannel", if(count(Q12_1, Q12_2, Q12_3, Q12_4, Q12_6, Q12_8, Q12_9) > 0, "Comprador regular", "Comprador irregular"))}
Joffm