Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Show question if answer from previous multichoice ques is gt 1 multichoice

  • Carolyn2017
  • Carolyn2017's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 6 months ago #188930 by Carolyn2017
I have a multichoice question Q24, it has 10 options, Q24_10 is none of the above, and used to filter some following questions (Q26 etc).

But in Q25 (radio) I only want this to show if more than 1 option from Q24, but not Q24_10.


((Q24_10.NAOK !="Y")) AND !sum (Q24_1, Q24_2, Q24_3, Q24_4, Q24_5, Q24_6, Q24_7, Q24_8, Q24_9 <=1).
It is hidden if Q24_10 is ticked or if any one item from Q24 is ticked,

but I can not now get it to show if more than 1 item from q 24 is ticked.
Has anyone got some advice
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188933 by DenisChenu
Think you need to add the NAOK inside the sum too.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago - 4 years 6 months ago #188934 by tpartner
Try this:

Code:
Q24_10.NAOK !="Y" AND count(that.Q24.NOAK) > 0

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 6 months ago by tpartner.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188935 by DenisChenu
@tpartner : need count except Q24_10 ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188937 by tpartner
I think the first condition excludes Q24_10.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188938 by Joffm
Hi, Carolyn2017,
for your better understanding.
Why doesn't your "sum(Q24_1,Q24_2,...)" work?

The results of the subquestions in a multiple question are stored as "Y" (=selected) or "" (=not selected).
So you try to sum something like "Y"+"Y"+""+"Y"+""+"". Because this is not possible the result of the sum always is "0".

Therefore you have to use the function "count".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Carolyn2017
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago - 4 years 6 months ago #188939 by DenisChenu

Joffm wrote: Hi, Carolyn2017,
for your better understanding.
Why doesn't your "sum(Q24_1,Q24_2,...)" work?

The results of the subquestions in a multiple question are stored as "Y" (=selected) or "" (=not selected).
So you try to sum something like "Y"+"Y"+""+"Y"+""+"". Because this is not possible the result of the sum always is "0".

Yes, totally right … sorry … must use count

And … i really think there are a potential NAOK issue …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 4 years 6 months ago by DenisChenu. Reason: Sorry : Joffm have right (like always)
The topic has been locked.
  • Carolyn2017
  • Carolyn2017's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 6 months ago #188990 by Carolyn2017
Thank you, but maybe I was not clear.

I want my following question (Q25) to only show if there are 2 options from the multichoice Q24, but not to include Q24_10 (none of the above).
that is I want it to show 2 items, but not including Q24_10.
So I tried

((Q24_10.NAOK!="Y")) AND count(Q24_1”Y"+Q24_2"Y"+Q24_3"Y"+Q24_4"Y"+Q24_5"Y"+Q24_6"Y"+Q24_7"Y"+Q24_8"Y"+Q24_9"Y") !=1
and
!count(Q24_1”Y"+Q24_2"Y"+Q24_3"Y"+Q24_4"Y"+Q24_5"Y"+Q24_6"Y"+Q24_7"Y"+Q24_8"Y"+Q24_9"Y") ==1
when I tried it with NOAK the relevance came up red.

count(Q24_1”Y"+Q24_2"Y"+Q24_3"Y"+Q24_4"Y"+Q24_5"Y"+Q24_6"Y"+Q24_7"Y"+Q24_8"Y"+Q24_9"Y".NAOK<=2.
any other suggestions. I am getting abit sad, the unit who support this just keep sending me the manual, so I am at abit of a loss.
Carolyn
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188995 by Joffm
tpartner showed already:

Q24_10.NAOK !="Y" AND count(that.Q24.NAOK) > 1


Obviously this equation says:
Only to display if: Q24_10 is not selected AND the count of the selected items of Q24 is gt 1.

Regarding your tries like

!count(Q24_1”Y"+Q24_2"Y"+Q24_3"Y"+Q24_4"Y"+Q24_5"Y"+Q24_6"Y"+Q24_7"Y"+Q24_8"Y"+Q24_9"Y") ==1

What made you get this idea?
PLEASE, read the parts in the manual (all in section "Expression Manager")
  • about implemented functions
  • about "this", that" and "self"
  • access to variables
  • study the demo surveys.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188997 by DenisChenu
We give a lot information, how, we this information you can write such equation:ohmy: :huh:

If you want to use your logic :
Code:
Q24_10.NAOK !="Y" AND count (Q24_1.NAOK, Q24_2.NAOK, Q24_3.NAOK, Q24_4.NAOK, Q24_5.NAOK, Q24_6.NAOK, Q24_7.NAOK, Q24_8.NAOK, Q24_9.NAOK) > 1

But @tpartner solution logic is OK too …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Carolyn2017
  • Carolyn2017's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 6 months ago #188998 by Carolyn2017
Thanks Joffm, I really appreciate your help. I found that example somewhere and thought it made sense, but obviously not.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose