Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: Piping Issue

Piping Issue 1 Jahr 2 Monate her #92319

  • StuartMark0
  • StuartMark0s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Karma: 0
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.
Letzte Änderung: 1 Jahr 2 Monate her von StuartMark0. Begründung: Further Explanation
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92332

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5845
  • Dank erhalten: 715
  • Karma: 222
Hello,
Did you have a look at adanced settings / filter array attribute ?

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

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92436

  • StuartMark0
  • StuartMark0s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92445

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5845
  • Dank erhalten: 715
  • Karma: 222
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92522

  • StuartMark0
  • StuartMark0s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92532

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5845
  • Dank erhalten: 715
  • Karma: 222
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
Letzte Änderung: 1 Jahr 2 Monate her von DenisChenu.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92533

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5845
  • Dank erhalten: 715
  • Karma: 222
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Piping Issue 1 Jahr 2 Monate her #92648

  • StuartMark0
  • StuartMark0s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Karma: 0
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Piping Issue 1 Jahr 2 Monate her #92650

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5845
  • Dank erhalten: 715
  • Karma: 222
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
Anhang:
Letzte Änderung: 1 Jahr 2 Monate her von DenisChenu.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Piping Issue 1 Jahr 2 Monate her #92660

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3813
  • Dank erhalten: 683
  • Karma: 328
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.166 Sekunden
Donation Image