Welcome to the LimeSurvey Community Forum

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

Filter by values of arrays

  • tpagliocco
  • tpagliocco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago - 2 years 11 months ago #230184 by tpagliocco
Filter by values of arrays was created by tpagliocco
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.3.22
Own server or LimeSurvey hosting: Limesruvey Hosting
Survey theme/template: Bubble
==================
I have a survey that I am building and so far every problem this forum has solved.  Thank you

Now I'm stuck and trying to find the right avenue.

Q1 - multiple choice - (pick who you met with)
Q2 - array_exclue - (give a reason why you didnt meet with the people you did not check in Q1)
Q3 - array_filter - (dual scale array , give a rating 1-5 for how influential and their level of support for the people you DID meet with - essentially the people checked in Q1)
Q4 - array_filter (3 point array - give a rating 1-3 for how much impact the person you DID meet with has - essentialy the people checked in Q1)

Now at Q5 I want to have anyone who total ofr the 3 values is equal to or less than 11 to be listed as "at risk" and a text box for each of the people to give a comment and reason why 

Its essentially the same format as Q2 but differnet logic  (name -- text box) but i need the subquestions to be anyone who total value of the 3 arrays is less than or equal to 11

Any thoughts? Thanks :(
Last edit: 2 years 11 months ago by tpagliocco. Reason: Added info and lss file

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #230185 by Joffm
Replied by Joffm on topic Filter by values of arrays
Better you send these questions as lss export.

I don't understand which "3 values".
Usually you use a relevance equation for each person like"shown in Q3 AND sum of rating values less than 11"

And why didn't you answer the questions displayed at the start?

Joffm 

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

Please Log in to join the conversation.

  • tpagliocco
  • tpagliocco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #230186 by tpagliocco
Replied by tpagliocco on topic Filter by values of arrays
Thank you Joffm

I updated my original with the info at the start - not sure how I missed it
Also added my LSS file

So in Question G00Q03, there are two rating values given and in G00Q04 there is one rating value given, both are in an array format

So if degree of influence + degree of impact + degree of support <= 11 , then show them in Question G00Q06 and the respondant will have to fill in a reason in a text box on why they are "at risk" or <= 11

Hope that makes more sense and thank you for replying!

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago - 2 years 11 months ago #230187 by tpartner
Replied by tpartner on topic Filter by values of arrays
You can use sub-question relevance but I don't get the logic. If you indicate that you did meet someone, you can select nothing in G00Q02 and only a maximum of 8 for them in questions G00Q03 and G00Q03. So it will always be <= 11.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 years 11 months ago by tpartner.

Please Log in to join the conversation.

  • tpagliocco
  • tpagliocco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #230188 by tpagliocco
Replied by tpagliocco on topic Filter by values of arrays
In G00Q03 - there are two ratings , influence and support both are 1-5
In G00Q04 - there is one scale for impact which is 1-3

So in essence if i I did 5 for influence, 3 or less for support and 3 for impact, the total would be 11 which anything 11 or less than labels that person "at risk"

So In Q1 - I am selecting who I met with that week
In Q2 - the people I did not select in Q1 , i have to give a reason why
Rest of the questions are focused on the people I selected in Q1

Hope that helps - I'm going to look up "sub question" relevance in the meantime see if that helps me - thank you for responding

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #230192 by tpartner
Replied by tpartner on topic Filter by values of arrays
I understand now. This is why Joffm asked for a .lss survey export (containing only the relevant questions).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tpagliocco

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #230195 by Joffm
Replied by Joffm on topic Filter by values of arrays
If you use numerical codes your subquestion relevances will be
!is_empty(G00Q03_SQ1_0.NAOK) and sum(G00Q03_SQ1_0.NAOK,G00Q03_SQ1_1.NAOK,G00Q04_SQ1.NAOK)<11
!is_empty(G00Q03_SQ2_0.NAOK) and sum(G00Q03_SQ2_0.NAOK,G00Q03_SQ2_1.NAOK,G00Q04_SQ2.NAOK)<11
...

Or with your alphanumerical coding:
!is_empty(G00Q03_SQ1_0.NAOK) and sum(if(G00Q03_SQ1_0.NAOK=="AO01",1,0), if(G00Q03_SQ1_0.NAOK=="AO02",2,0), if(G00Q03_SQ1_0.NAOK=="AO03",3,0), if(G00Q03_SQ1_0.NAOK=="AO04",4,0), if(G00Q03_SQ1_0.NAOK=="AO05",5,0), if(G00Q03_SQ1_1.NAOK=="AO01",1,0), if(G00Q03_SQ1_1.NAOK=="AO02",2,0), if(G00Q03_SQ1_1.NAOK=="AO03",3,0), if(G00Q03_SQ1_1.NAOK=="AO04",4,0), if(G00Q03_SQ1_1.NAOK=="AO05",5,0), if(G00Q04_SQ1.NAOK=="AO01",1,0), if(G00Q04_SQ2.NAOK=="AO03",2,0), if(G00Q04_SQ3.NAOK=="AO02",3,0))<11
...
Really not the best way.

Meaning:; In scales you always should use numerical codes.
How do you imagine to calculate a mean later?

BTW: Why are Q2 and G00Q06 questions of type "multiple with comment" and not a "short text" or "multiple short text"?

Joffm
 

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

Please Log in to join the conversation.

  • tpagliocco
  • tpagliocco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #230197 by tpagliocco
Replied by tpagliocco on topic Filter by values of arrays
"BTW: Why are Q2 and G00Q06 questions of type "multiple with comment" and not a "short text" or "multiple short text"?"

Because the example I found in the documentation was using those and it worked for what I was trying to accomplish, I'll try changing them and see if it's easier

The funny part is, they dont have to be scales - I just need the user to rate the people they met with on 3 criteria (1-5, 1-5, and 1-3) , and then the output of that be used to judge if they are considered a risk

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #230199 by Joffm
Replied by Joffm on topic Filter by values of arrays

I found in the documentation was using those and it worked for what I was trying to accomplish

No doubt, it does.
But it is not the suitable question type if you want the respondent to enter some text.
This type is to select some options out of a predefined sample and give optionally a comment.
But here the respondents are forced to enter something.
Read the manual about question types. and study the sample survey about all question types in the demo installation.
[url] demo.limesurvey.org/index.php?r=admin [/url]

Joffm

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

Please Log in to join the conversation.

  • tpagliocco
  • tpagliocco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #230201 by tpagliocco
Replied by tpagliocco on topic Filter by values of arrays
Thank you all for your help - i changed the codes to numbers, reformatted a couple of quesitons - and it's working now as intended
This platform is way more powerful than I remember it in 2007 lol

Again, my appreciation, hope I can give back someday to pay it forward. 

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose