Filtering questions based off a single column in an Array (Text)

More
3 weeks 4 days ago #177131 by Racheltownsend1
Racheltownsend1 created the topic: Filtering questions based off a single column in an Array (Text)
Below is a pic of what I am trying to do.

I am trying to figure out how to get the sub-questions in Q2d to filter based off of columns 3 (pyrosequencing) and 7 (send out) only. The way I have it now, it is filtering off of all columns that have a check mark.

So, for Q2d to show up the way I want it to, only Gastrointestinal Stromal Tumors and Glioblastoma would show up.

Any idea what code I need to enter under the filter field in order to filter just the sub-questions that have check marks in columns 3 and/or 7?

Attachments:

Please Log in or Create an account to join the conversation.

More
3 weeks 4 days ago #177132 by jelo
jelo replied the topic: Filtering questions based off a single column in an Array (Text)
Attach a survey with the relevant questions as an LSS export here to this thread.
What version of LimeSurvey is used?


The questiontype looks like Array (Numbers) with Checkbox style.
The access of these variables are
Questioncode_YAXISanswercode_XAXISanserscode.NAOK

E.g. qa_SQY01_SQX01.NAOK
when qa is the questioncode
when Y-Axiscodes are SQY01, SQY02 etc.
when X-Axiscodes are SQX01, SQX02 etc.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Please Log in or Create an account to join the conversation.

More
3 weeks 4 days ago #177134 by Racheltownsend1
Racheltownsend1 replied the topic: Filtering questions based off a single column in an Array (Text)
Thank you for your help, Jelo. I am a new user, and I am not a coder, so I have a lot to learn.


I am using Version 3.15.1+181017

The file you requested is attached.

Right now I just have the filter set to Q2, which is why it is pulling any answer that is checked. I tried entering different things, like ! is_empty(Q2_SQ001_SQ001), in the filter field, but I still couldn't get it to work right. I'm not sure what the correct way is to identify a checked box in a certain column.
Attachments:

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #177139 by jelo
jelo replied the topic: Filtering questions based off a single column in an Array (Text)
You seem to use an arrayfilter instead of subquestion relevance.

Remove all conditions or relevance from a question and then begin to experiment with subquestionrelevance.



Instead of 1 you write relevance with ExpressionScript (still labled ExpressionManager).

E.g. !is_empty(Q2_SQ001_SQ007.NAOK) etc.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
Attachments:
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #177147 by DenisChenu
DenisChenu replied the topic: Filtering questions based off a single column in an Array (Text)
I move this topic : totally unrelated to Development

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago - 3 weeks 3 days ago #177191 by Racheltownsend1
Racheltownsend1 replied the topic: Filtering questions based off a single column in an Array (Text)
Thanks for your help, Jelo. I was finally able to figure it out after you pointed me in the right direction. Not sure if it's the best way to do it, but at least it works!

Thought I'd post pics of what I did just in case anyone else ever needs help with the same issue.

Step 1 - enter a relevance equation for Q2b (question 2b) so the question only shows up if subquestions in columns 3 or 7 are selected.
Step 2 - in the filter field, enter question code for the question I want to filter (Q2)
Step 3 - enter relevance equations for each subquestion for Q2b so only the subquestions in columns 3 or 7 show up when selected.

Step 1 image:




Step 2 image:


Step 3 image:
Attachments:
Last Edit: 3 weeks 3 days ago by Racheltownsend1.

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #177192 by jelo
jelo replied the topic: Filtering questions based off a single column in an Array (Text)

Racheltownsend1 wrote: Thanks for your help, Jelo. I was finally able to figure it out after you pointed me in the right direction. Not sure if it's the best way to do it, but at least it works!


Did you try it with just step3 first? Without question relevance and arrayfilter the question should only be shown if one of the subquestions are with relevance. I didn't checked it, so LimeSurvey might not that clever and an empty question would be shown.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #177193 by Racheltownsend1
Racheltownsend1 replied the topic: Filtering questions based off a single column in an Array (Text)
Yes, I did try it with just Step 3 first, but if I do that then Question Q2d always shows up - pic below. Since I only want Q2d to show up if columns 3 or 7 are selected, I had to put a relevance equation for Q2d, as well.

Out of curiosity, I did go back and delete Q2 from the filter field to see if that changed anything. It doesn't seem to matter if the filter code is there or not, so I guess that step can be skipped.

Attachments:

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #177196 by jelo
jelo replied the topic: Filtering questions based off a single column in an Array (Text)
I tried to reproduce the issue that a question is shown, when all subquestion are having a relevance of 0.

Looks fine under 3.15.5. for me.



Every subquestion with a relevance of 0 and complete question is hidden.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
Attachments:

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!