Count Total Options Function

Hi all,

With regards to multi-select helper functions, in a multiple-answer
question I am currently using the count-selected() function as the
numerator and the total number of options as the denominator to get the
percentage of items selected. Is there a function that counts the total
number of options available in a multi-answer question? This would greatly
reduce error and keep the calculations relevant when options are
added/removed.

count() does not seem to work on this.

Thanks!

Ralph

Ralph,

Unfortunately due to the model/view separation in the XForms standard
there’s no way for this to work for standard multiselect questions. The
backend simply doesn’t know what the specific question is. Sorry there’s no
way to automate things.

-Clayton

··· On Fri, Jan 22, 2016 at 9:37 AM, wrote:

Hi all,

With regards to multi-select helper functions, in a multiple-answer
question I am currently using the count-selected() function as the
numerator and the total number of options as the denominator to get the
percentage of items selected. Is there a function that counts the total
number of options available in a multi-answer question? This would greatly
reduce error and keep the calculations relevant when options are
added/removed.

count() does not seem to work on this.

Thanks!

Ralph


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.