Welcome to the LimeSurvey Community Forum

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

Filter from two different questions?

  • eniisula
  • eniisula's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 1 month ago #228037 by eniisula
Filter from two different questions? was created by eniisula
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.3.11+220425
Own server or LimeSurvey hosting: own

==================
I have attached the survey. The "logic" we are trying to achieve is this:
The second question (question in group 2) gets the columns from the answers selected in question in the first group.
For the question in third group I want as rows (or columns) the answers selected from first question
and as columns (or rows) I want the subquestions in y-scale that are selected in second question.

Is there a way we can achieve this?

Thank you in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago - 3 years 1 month ago #228041 by Joffm
Replied by Joffm on topic Filter from two different questions?
1. Remove the array filter Q11 from Q14
2. Use this as x-scale of Q14 (to be able to use the "hideEmptyColumn" feature)
{if(count(that.Q11.sq_A2)-count(Q11_A2_15)>0,"Q11_A2_text","")}
{if(count(that.Q11.sq_A3)-count(Q11_A3_15)>0,"Q11_A3_text","")}

If I understand correctly you want to show the selected products of Q11. This is an array(numbers).
So you check the count of answers with function count(), but have to subtract the mention of "None of these" (this is a normal option, so will be counted)
You can't insert the text by ExpressionScript, so manually.




Here the text has to be inserted into the subquestion.



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 1 month ago by Joffm.

Please Log in to join the conversation.

  • eniisula
  • eniisula's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 1 month ago #228044 by eniisula
Replied by eniisula on topic Filter from two different questions?
Would it be too much if asked you to send me your .lss you tested this? Because we are having trouble implementing it.

Either way, thank you for your provided solution!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #228051 by Joffm
Replied by Joffm on topic Filter from two different questions?
I did exactly what I wrote, nothing else

 

It would be easier if "None of these" was exclusive, and the question mandatory
Then this would be sufficient
{if(Q11_A2_15!=1,"Q11_A2_text",'')}   (if it is not "None of these" there was something selected)
{if(Q11_A2_15==1,"","Q11_A2_text")}   (the other way around)

Anyway, you know what you have to do.
Make sure that the text of the x-scale subquestion text is empty, if "None of these" was selected, else enter the name of the product.
And you know the impemented functions like "count()", "countif()", "countifop()" which may be of interest, and the way variables like "self" and "that" work.

Best regards
Joffm

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

Please Log in to join the conversation.

  • eniisula
  • eniisula's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 1 month ago #228052 by eniisula
Replied by eniisula on topic Filter from two different questions?
Thank you again! :)
I will do none of these exclusive. I have a script for that. And I tried implementing this very same way but the products in Q11 are not shown correctly in Q14. Our head is spinning if you could check this .lss I have attached here it would be wonderful.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose