I would like to set a validation equation for each sub-question of my checkbox array question. This question already has an array filter from a previous question (meaning, users are only prompted to answer for options they have selected in a previous question). Now I want to ensure that they only select up-to 3 options per row in this question. I wrote this equation to try to account for the fact that some rows will remain empty, but I get stuck and cannot move to the following page, no matter what I do.
((is_empty(self.sq_a) OR count(self.sq_a) <= 3)) AND ((is_empty(self.sq_b) OR count(self.sq_b) <= 3)) AND ((is_empty(self.sq_c) OR count(self.sq_c) <= 3)) AND ((is_empty(self.sq_d) OR count(self.sq_d) <= 3)) AND((is_empty(self.sq_e) OR count(self.sq_e) <= 3)) AND ((is_empty(self.sq_f) OR count(self.sq_f) <= 3)) AND ((is_empty(self.sq_g) OR count(self.sq_g) <= 3)) AND ((is_empty(self.sq_h) OR count(self.sq_h) <= 3)) AND ((is_empty(self.sq_j) OR count(self.sq_j) <= 3))
I solved my question, in case somebody else experiences the same problem in the future:
(count(self.sq_a.NAOK) <= 3) AND (count(self.sq_b.NAOK) <= 3) AND (count(self.sq_c.NAOK) <= 3) AND (count(self.sq_d.NAOK) <= 3) AND (count(self.sq_e.NAOK) <= 3) AND (count(self.sq_f.NAOK) <= 3) AND (count(self.sq_g.NAOK) <= 3) AND (count(self.sq_h.NAOK) <= 3) AND (count(self.sq_j.NAOK) <= 3)