Welcome to the LimeSurvey Community Forum

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

Array filtered by previous array

  • Giorgio97
  • Giorgio97's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #240019 by Giorgio97
Array filtered by previous array was created by Giorgio97
Hi,
I have a question A1 which is an array. Then, I have another array A2, where I should show only those questions that got answer == 1 in the previous array.

Could you give me some tips?

Thanks in advance,
Giorgio

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #240020 by Joffm
Replied by Joffm on topic Array filtered by previous array
Use subquestion relevance in the second array
like
A1_SQ001==1

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Giorgio97
  • Giorgio97's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #240026 by Giorgio97
Replied by Giorgio97 on topic Array filtered by previous array
Thank Joffm!
I just started using Limesurvey, so I don't know why the equation doesn't work. I also tried by using a script adding a multiple choice question but it didn't work.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago - 1 year 2 months ago #240030 by Joffm
Replied by Joffm on topic Array filtered by previous array
You do not need a script, you do not need anything else.
Just enter the condition to show the specific subquestion into "relevance equation" of subquestion of A2.
And the equation I showed is that what you told us.

 that got answer == 1 in the previous array.

The condition of the subquestion of A2 is, that the code in A1 is equal 1.
Please, learn the basics about QCode variable naming

Please read the manual about ExpressionScript generally
and this
[url] manual.limesurvey.org/Adding_answers_or_...fic_for_subquestions [/url]

Study the sample surveys included in the manual
[url] manual.limesurvey.org/ExpressionScript_sample_surveys/en [/url]
and in the demo installation
[url] demo.limesurvey.org/index.php?r=admin [/url]

"It doesn't work" is not very useful.
Attach a lss export of these relevant question to show us what you realy did.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 2 months ago by Joffm.

Please Log in to join the conversation.

  • Giorgio97
  • Giorgio97's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #240035 by Giorgio97
Replied by Giorgio97 on topic Array filtered by previous array
Thank you very much for all the links! Now it works

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose