Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Piping Issue

Piping Issue 1 year 6 months ago #92319

Hi LS,

I have been trying to get this piping in my survey, however either it pipes everything or nothing: for example:

Q1: Which of the following actions have you undertaken in your household?
A. Action1
B. Action2
C. Action3
D. Action4
E. Action5

Q2: (Instruction) - show list of actions answered in Q1.
How may actions have you seen it in XYZ's Advertisement?
A. Action1
B. Action2
C. Action3
D. Action4
E. Action5


If I have selected 2, 3, and 5 - I need to see only 2,35 in Q2 - however I cant get this right. Please help.

Thanks

Cheers,
Mark.
Last Edit: 1 year 6 months ago by StuartMark0. Reason: Further Explanation
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92332

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6276
  • Thank you received: 801
  • Karma: 241
Hello,
Did you have a look at adanced settings / filter array attribute ?

docs.limesurvey.org/Question+type+-+Array#Array_filter

Denis
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92436

Hi Denis,

Thanks for your reply, Apologies I was not detailed in my query.

Filter array works when it is a multiple choice which reads the data as Yes/No - however what I had was three point scale viz:

Q1: Which of the following actions have you undertaken in your household?
A. Action1 Yes No Not relevant for me
B. Action2 Yes No Not relevant for me
C. Action3 Yes No Not relevant for me
D. Action4 Yes No Not relevant for me
E. Action5 Yes No Not relevant for me

Q2: (Instruction) - show list of actions answered 'YES' in Q1.
How may actions have you seen it in XYZ's Advertisement?
A. Action1
B. Action2
C. Action3
D. Action4
E. Action5

Here, I would like to pipe statements which were selected as YES and I do not want to pipe statements which were 'No' and 'Not relevant for me'.


How do I solve this?

Cheers,
Mark.
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92445

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6276
  • Thank you received: 801
  • Karma: 241
Oh,

You're right, actually there are no automatic system to do this.

Sometimes i use a javascript way:
Add a Q1bis question : multi check.
Add a javascript to check/uncheck "corresponding Multi checking on Q1bis from Q1"
Filter array by Q1bis.

Denis
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92522

Hi Denis,

Thanks for your help so far.

I am beginner to Java scripting & LS, will you be able to share if you have that check/uncheck script handy?

It will be a great help.

Cheers,
Mark.
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92532

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6276
  • Thank you received: 801
  • Karma: 241
Hello,

Quick way:
Multi hidden
 
<script charset="utf-8" type="text/javascript">
$(function() {
  // $("question{QID}").hide();
  $("#javatbd{Q1_A1.SGQA}").click(function(){
    if($("[name='{Q1_A1.SGQA}']:checked").val()=="YES"){
      $("#answer{Q1bis_A1.SGQA}").attr("checked","checked");
    }else{
      $("#answer{Q1bis_A1.SGQA}").removeAttr("checked");
    }
      $("#answer{Q1bis_A1.SGQA}").triggerHandler("click");
  });
  $("#javatbd{Q1_A2.SGQA}").click(function(){
    if($("[name='{Q1_A2.SGQA}']:checked").val()=="YES"){
      $("#answer{Q1bis_A2.SGQA}").attr("checked","checked");
    }else{
      $("#answer{Q1bis_A2.SGQA}").removeAttr("checked");
    }
      $("#answer{Q1bis_A2.SGQA}").triggerHandler("click");
  });
  $("#javatbd{Q1_A2.SGQA}").click(function(){
    if($("[name='{Q1_A2.SGQA}']:checked").val()=="YES"){
      $("#answer{Q1bis_A2.SGQA}").attr("checked","checked");
    }else{
      $("#answer{Q1bis_A2.SGQA}").removeAttr("checked");
    }
      $("#answer{Q1bis_A2.SGQA}").triggerHandler("click");
  });
});
</script>

See lss file
Last Edit: 1 year 6 months ago by DenisChenu.
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92533

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6276
  • Thank you received: 801
  • Karma: 241
The administrator has disabled public write access.

Piping Issue 1 year 6 months ago #92648

Hi Denis,

Thanks for the script, I have understood the logic however I am not able to get this working so far, will you be able help me with the syntax?

Multi hidden <script charset="utf-8" type="text/javascript">
$(function() {
// $("question{3121}").hide();

$("#javatbd{131384X198X2942ber1_A1}").click(function(){
if($("[name='{131384X198X2942ber1_A1}']:checked").val()=="YES"){
$("#answer{131384X198X3121ber1}").attr("checked","checked");
}else{
$("#answer{131384X198X3121ber1}").removeAttr("checked");
}
$("#answer{131384X198X3121ber1}").triggerHandler("click");
});


$("#javatbd{131384X198X2942ber2_A1}").click(function(){
if($("[name='{131384X198X2942ber2_A1}']:checked").val()=="YES"){
$("#answer{131384X198X3121ber2}").attr("checked","checked");
}else{
$("#answer{131384X198X3121ber2}").removeAttr("checked");
}
$("#answer{131384X198X3121ber2}").triggerHandler("click");
});


$("#javatbd{131384X198X2942ber3_A1}").click(function(){
if($("[name='{131384X198X2942ber3_A1}']:checked").val()=="YES"){
$("#answer{131384X198X3121ber3}").attr("checked","checked");
}else{
$("#answer{131384X198X3121ber3}").removeAttr("checked");
}
$("#answer{131384X198X3121ber3}").triggerHandler("click");
});

});
</script>



ber1 = Action 1
ber2 = Action 2
ber3 = Action 3

A1 = Yes
A2 = No
A3 = Not relevant for me.

Thanks a million.

Cheers,
VP
The administrator has disabled public write access.

Piping Issue 1 year 6 months ago #92650

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6276
  • Thank you received: 801
  • Karma: 241
Hello,

Replace the 131384X198X2942 and 131384X198X3121 by the questions code.

Look at Expression Manager doc.

And the lss file is here: www.sondages.pro/IMG/lss/limesurvey_surv...rayfilter-script.lss
Attachments:
Last Edit: 1 year 6 months ago by DenisChenu.
The administrator has disabled public write access.

Re: Piping Issue 1 year 6 months ago #92660

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4139
  • Thank you received: 767
  • Karma: 348
This thread about using a hidden multiple-options to filter subsequent questions may be of some help - www.limesurvey.org/en/forum/can-i-do-thi...nditional-list#92604
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.146 seconds
Donation Image