Your LimeSurvey version: LimeSurvey Community Edition V. 3.28.3 Own server or LimeSurvey hosting: Our own server Survey theme/template: Our own template (based on Fruity)
==================
Hello everyone,
I have a survey in which there is a numeric array (Q6) with subquestions filtered according to the previous multiple-choice question (Q5).
The sum of each subquestion/row in Q6 should be greater than zero (because they selected these non-zero options in Q5), yet it should also allow leaving some fields blank (because filling in many 0s would be tiring).
The Q6 is not mandatory (to allow leaving blank fields), but I needed at least one non-zero response in at least one column in each row, so I made it kinda mandatory via the question validation equation. The equation states that the sum must be greater than zero in each row.
I tried sum(self.sq_001.NAOK) !=0 ANDsum(self.sq_002.NAOK) !=0 ANDsum(self.sq_003.NAOK) !=0 ANDsum(self.sq_004.NAOK) !=0 AND
etc
I tried other variants, but none worked. It seems like the filtered-out subquestions fail the validation equation despite NAOK.
A sample of the survey is attached.
Thank you!
Jakub
You can add a condition that the corresponding row in Q5 is not empty:
Code:
(is_empty(Q5_SQ001.NAOK) OR sum(self.sq_001.NAOK) > 0) AND
(is_empty(Q5_SQ002.NAOK) OR sum(self.sq_002.NAOK) > 0) AND
(is_empty(Q5_SQ003.NAOK) OR sum(self.sq_003.NAOK) > 0) AND
(is_empty(Q5_SQ004.NAOK) OR sum(self.sq_004.NAOK) > 0) AND...