Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Column Piping Issue

Column Piping Issue 10 Monate 3 Wochen her #100466

I have followed the tutorial here: manual.limesurvey.org/Workarounds:_Manip...ime_using_Javascript
(Filter "Array by Column" Question With "Multiple-Options")

I cannot get this working. I have an urgent need to fix this for a large national company survey.

The first question is multiple choice (5-options). The second question is a Numerical Array (using checkboxes, for multiple select) and I need to pipe the answers chosen in the multiple-choice question to the columns (x-axix, horizontal) choices in the array. I need ONLY the ones chosen to show. I had it working so that all would show but then 2 or 3 column titles would be blank and still show checkboxes.

Can someone please help me with the correct javascript to use, where and how?

Please see image which shows the two questions.

Thank you!
Dawna
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Column Piping Issue 10 Monate 3 Wochen her #100472

  • holch
  • holchs Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 2621
  • Dank erhalten: 307
  • Karma: 113
If you could put this into the vertical item list on the left (so switch the axis) the solution would be very simple: array_filter. I don't know if the array filter is available for the way you want to use it.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Column Piping Issue 10 Monate 3 Wochen her #100473

  • holch
  • holchs Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 2621
  • Dank erhalten: 307
  • Karma: 113
Seems like the array filter is also available for the array by column option:

manual.limesurvey.org/Question_type_-_Ar...r_.28array_filter.29
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Column Piping Issue 10 Monate 3 Wochen her #100477

Thanks but I need to use array (numbers) using checkboxes for Q2 and I need the columns to be piped in. I know it can be done as there is a tutorial on it, but it might be for an older version of LimeSurvey. I am hoping a Javascript Expert like Tony P. will know some quick JS code to do what I need.

Thanks though.
Dawna
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Column Piping Issue 10 Monate 3 Wochen her #100478

I have tried this about 100 different ways and I am close. If someone knows some javascript to hide the empty columns (with no labels), I would be all set. This is due on Monday so I would GREATLY appreciate it.

I am attaching a copy of the survey.

Thanks.
Dawna
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Column Piping Issue 10 Monate 2 Wochen her #100521

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4127
  • Dank erhalten: 761
  • Karma: 347
Add this script to the source of the array question. It will loop through all of the column headers and, if found to be empty, will hide all answer cells in that column.

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		$('#question{QID} .subquestions-list thead th').each(function(i) {
			if($.trim($(this).text()).length == 0) {
				var colIndex = i;
				$(this).hide();
				$('#question{QID} .questions-list').each(function() {
					$('.question-item:eq('+colIndex+')', this).hide();
				});
			}
		});
	});
</script>
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.
Folgende Benutzer bedankten sich: wireframemedia

Column Piping Issue 10 Monate 2 Wochen her #100523

Thanks Tony, that worked like a charm!
Exactly what I needed.
Great support as usual.

Take care.
Dawna
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.162 Sekunden
Donation Image