Welcome to the LimeSurvey Community Forum

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

show groups on condition

More
3 years 7 months ago - 3 years 6 months ago #223981 by john_bons
Dear team.I have a survey where the respondent answers 4 questions in group 1 about Work (W) , Grocery (G), non grocery (N) and Leisure (LST)and then I have following groups that are to be displayed on certain conditions:1) only 4 groups out of 6 below are to be displayed in total max2)WGN (1.1 Typical trip - work, 1.2 Typical trip - grocery,1.3 Typical trip - non-grocery shopping )  to be displayed always if answered by user i.e. the answer for them is anything but ''nooit'' and3)LST (1.4 Typical trip - leisure, 1.4 Typical trip - social, 1.4 Typical trip - touring )  depending on which of them is answered and how many WGN , coz in total only 4 groups are to be displayed at maxi.e.If lst == 1 (i,e, leisure, social or touring one of them is answered by respondent  i.e. (LSTFreq_SQ001 != "A6" or LSTFreq_SQ002 != "A6" or LSTFreq_SQ003 != "A6"))), Then show that 1 lstIf (lst ==2)
Last edit: 3 years 6 months ago by holch. Reason: LSS file removed based on a request from the original owner of the questionnare via admin notification
The topic has been locked.
More
3 years 7 months ago - 3 years 6 months ago #224087 by Joffm
Replied by Joffm on topic show groups on condition
Hi,at first: Why didn't you answer the questions at the beginning?As far as I understand, you want to display up to 4 groups out of these 6.WGN always if the question is not answered "I do not..."As many of the LST groups to reach the maximum of 6.Well, here is a solution with only built in equations.All equations in group "equation" have to be set to "Always hide this question" after you understood the workflow.Everything should be easy to understand.And the joining of the '

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by holch. Reason: LSS/image file removed based on a request from the original owner of the questionnare via admin notification
The topic has been locked.
More
3 years 7 months ago #224094 by john_bons
Replied by john_bons on topic show groups on condition
Dear Joffm,

Firstly thank you soooo much! Indeed a very smart and efficient way to resolve the problem.

I am sorry but I did not understand by - Why didn't you answer the questions at the beginning?
The topic has been locked.
More
3 years 7 months ago #224096 by Joffm
Replied by Joffm on topic show groups on condition
When you started this new topic you should have seen these questions.
 

These informations about the used version, the place where LS is hosted (own server, LimeSurvey Cloud, "university" installation, or...) and the used theme are really important for us.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 7 months ago #224097 by john_bons
Replied by john_bons on topic show groups on condition
oh okay. I will keep this in mind for next time.
The topic has been locked.
More
3 years 7 months ago - 3 years 7 months ago #224162 by Joffm
Replied by Joffm on topic show groups on condition
Hi,
I realized that there is a small glitch in my solution.

Change the equation "eqLSTGroupsFinal" to
{if(eqNumWGN==3,substr(eqLSTGroups,eqRandLST-1,1),if(eqNumWGN==2,if(eqNumLST==3,str_replace(substr(eqLSTGroups,eqRandLST-1,1),"",eqLSTGroups),eqLSTGroups),eqLSTGroups))}

Sorry

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 7 months ago by Joffm.
The following user(s) said Thank You: john_bons
The topic has been locked.
More
3 years 7 months ago #224239 by john_bons
Replied by john_bons on topic show groups on condition
thank you.
The topic has been locked.
More
3 years 6 months ago #224422 by john_bons
Replied by john_bons on topic show groups on condition
Dear Joffm,Thank you for resolving the first part. unfortunately our survey is bit long and so we are unable to activate it on our instance since it says - too many questions and subquestions. Could you help me how to resolve the issue?
The topic has been locked.
More
3 years 6 months ago - 3 years 6 months ago #224423 by Joffm
Replied by Joffm on topic show groups on condition
[url] www.limesurvey.org/manual/General_FAQ/en...egarding_survey_size [/url]

1. Remove questions and/or subquestions.

2. Split the survey into two parts and join by end-url

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by Joffm.
The topic has been locked.
More
3 years 6 months ago #224428 by Joffm
Replied by Joffm on topic show groups on condition
In my opinion you can do a lot.

I only looked at S1
Instead of creating 16 question you can display 1 question and pipe the text by tayloring.
Either you use an IF-statement or you may use a question of type "huge text" to store all possible answers and select by the function "substr".

Then these 4 questions "HousePartner..."
Only 1 of the 4 question is displayed to a respondent.
And the question is the same and the subquestions are nearly the same.
So you can use subquestion relevance.


So revise your design carefully.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 6 months ago #224461 by Joffm
Replied by Joffm on topic show groups on condition
Of course, the crucial thing are the groups S1-S8.

Here you use 1024 columns.
But usually this type of question is asked as single punch question.
Seeing this design I remembered a colleague of you with this requirement.

To use single punch see here the "old" apple-banana example.
[url] forums.limesurvey.org/forum/can-i-do-thi...ions-in-a-box#194429 [/url]

Or you use tayloring.
Either by some nested IF-statements, like
{if(ask1==1,"Text 1",if(ask1==2,"Text 2",if(ask1==3,"Text3,... )))}
what you enter in each cell.

or you may use a text question where you store all texts in a certain (fixed width) format. You grab the desired text by something like
Code:
<td style="background-color:#f2f2f2;text-align: center;vertical-align:middle;font-size:14pt;"><strong>
{trim(substr(substr(H1, (substr(H0, 3, 3) - 1) * 80, 80),0,20))}
</strong></td>
In this example each text was 20 characters long and there were 4 attributes (4x20 = 80)

In the German part of this forum there is my Tutorial "Joffms Tutorial 3: Gimmicks..." where you find this in Group G10 to Group G11c.
And there is a link to a lss file.

In my opinion the same with all these Switch questions. The answer options are the same; so you only have to taylor the question text.

Furthermore there a many question displayed several times without need. I already mentioned this.
E.g. the 4 "OwnCar" questions.
There is only one of these 4 questions asked depending on HouseComposition and NumberCars.
Again use tayloring of the text, like
{if(NumberCars=="A3" OR NumberCars=="A4", "...meest gebruikte ...", "")}
And subquestion relevance that the second row is only displayed if there are 2 or more cars.
By the way: Why didn't you use numerical codes?

As said before: Revise your structure.

Joffm





 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 6 months ago #224470 by Joffm
Replied by Joffm on topic show groups on condition
Now I realizede that the structure of all "Situaties" is equal.
So you only have to taylor the numbers and some texts in the MaaS column

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 6 months ago - 3 years 6 months ago #224484 by Joffm
Replied by Joffm on topic show groups on condition
Hi,
1. Here a small example how to taylor your questions S1.
I only did it for 5 instead for 16 and only for the first row "Kosten".
But you see, how it works.
 
This way you have only one question instead of 16. and the same for the Switches.

2. Please read the manual about "access to variables", "implemented functions" and the "this", "self" and "that" variables.
[url] www.limesurvey.org/manual/ExpressionScri...#Access_to_variables [/url]
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]
[url] www.limesurvey.org/manual/ExpressionScri....22that.22_variables [/url]


This can be improved:
Do not use the INSERTANS - stuff, use Expression Manager!

And here two examples:
a. Bagage maat was: {if(LuggageGrocery =="A1", "lichte bagage")}{if(LuggageGrocery =="A2", "bagage van gemiddeld gewicht")}{if(LuggageGrocery =="A3", "zware bagage")}{if(LuggageGrocery =="A4", "neen")}

Better: 
Bagage maat was: {LuggageGrocery.shown}

b: De weer was: {if(WeatherGrocery_SQ001 =="Y","regen")} {if(WeatherGrocery_SQ002 =="Y","lichte wind")} {if(WeatherGrocery_SQ003 =="Y","sterke wind")} {if(WeatherGrocery_SQ004 =="Y","mist")} {if(WeatherGrocery_SQ005 =="Y","zonnig")} {if(WeatherGrocery_SQ006 =="Y","bewolkt")} {if(WeatherGrocery_SQ007 =="Y","sneeuw")} {if(WeatherGrocery_SQ008 =="Y","onweer")} {if(WeatherGrocery_SQ009 =="Y","niets / weet niet")}

Better: 
De weer was: {list(that.WeatherGrocery.shown)}

3. If you revise your table and use a border instead of the cell with width="0" you get a better display.
 

Furthermore remove these <span><span><span>
Like this line
<p><span style="font-size: 11pt;"><span style="line-height: normal;"><span style="font-family: Arial,sans-serif;"><span style="font-size: 14pt;"><span style="font-family: &quot;Calibri&quot;,sans-serif;"><span style="color: black;">3. Eventueel andere factoren hetzelfde zijn voor alle opties, aan uw wensen voldoen, en dus uw keuze niet beïnvloeden.</span></span></span></span></span></span></p>

First the font-size is set to 11pt, but later to 14pt without any reason. And the font-family set twice, too.

Maybe better you use <div> and define some classes in the <style>-section. 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by holch. Reason: LSS/image file removed based on a request from the original owner of the questionnare via admin notification
The following user(s) said Thank You: john_bons
The topic has been locked.
More
3 years 6 months ago - 3 years 6 months ago #224502 by Joffm
Replied by Joffm on topic show groups on condition
And with some - in my opinion better - styling (some classes and DIVs you can achieve this: And also in my opinion you should use Dutch everywhere.So replace "year", "month" and "h"  by "jaar", "maand" and "uur". And some typos.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by holch. Reason: LSS/image file removed based on a request from the original owner of the questionnare via admin notification
The topic has been locked.
More
3 years 6 months ago #224519 by holch
Replied by holch on topic show groups on condition
Due to a request by the someone who claimed to be the original owner of this questionnaire to the moderators, have deleted the LSS files (and just to make sure also the screenshots).

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose