- Posts: 14
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
4 years 6 months ago #188930
by Carolyn2017
Show question if answer from previous multichoice ques is gt 1 multichoice was created 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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 6 months ago #188933
by DenisChenu
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.
Replied by DenisChenu on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
4 years 6 months ago - 4 years 6 months ago #188934
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 6 months ago #188935
by DenisChenu
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.
Replied by DenisChenu on topic Show question if answer from previous multichoice ques is gt 1 multichoice
@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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
4 years 6 months ago #188937
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 6 months ago #188938
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 6 months ago - 4 years 6 months ago #188939
by DenisChenu
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.
Replied by DenisChenu on topic Show question if answer from previous multichoice ques is gt 1 multichoice
Yes, totally right … sorry … must use countJoffm 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".
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 6 months ago #188990
by Carolyn2017
Replied by Carolyn2017 on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 6 months ago #188995
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Show question if answer from previous multichoice ques is gt 1 multichoice
tpartner showed already:
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
PLEASE, read the parts in the manual (all in section "Expression Manager")
Joffm
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
What made you get this idea?!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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 6 months ago #188997
by DenisChenu
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.
Replied by DenisChenu on topic Show question if answer from previous multichoice ques is gt 1 multichoice
We give a lot information, how, we this information you can write such equation:ohmy: :huh:
If you want to use your logic :
But @tpartner solution logic is OK too …
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 6 months ago #188998
by Carolyn2017
Replied by Carolyn2017 on topic Show question if answer from previous multichoice ques is gt 1 multichoice
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.