Count the answers from 3 different arrays instantaneously

More
10 months 5 days ago #158683 by gywon1
gywon1 created the topic: Count the answers from 3 different arrays instantaneously
Hi,

I have a problem that I tried many times but cannot solve, could anyone help?
My question:

Array1: a1, a2, a3, a4, a5
Array2: b1, b2, b3, b4, b5 (hide until 5 answers from Array1 is all chosen)
Array3: c1, c2, c3, c4, c5 (hide until 5 answers from Array2 is chosen)

Total: sum of the answers selected from Array1,2&3

My problem is:
if the participant chose only 3 answers from Array1, the total {count(that.Array1,that.Array2,that.Array3)} should only display "3". However, it cannot calculate or display anything. When I do a test: I created an individual questions in between Array1&2 to do the counting, and it can display "3" correctly. Why can't I make the count when Array2 & 3 are hiding?

It will be greatly appreciate if somebody can help, many thanks.

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #158687 by Joffm
Joffm replied the topic: Count the answers from 3 different arrays instantaneously
Hello, gywon1,
correct, it cannot calculate, because there are still some missing fields.
This is normal behaviour.

You have to use "NAOK".
https://manual.limesurvey.org/Expression_Manager#Usage_of_NAOK

{count(that.A1.NAOK,that.A2.NAOK,that.A3.NAOK)}

Best regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: DenisChenu, tpartner

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #158707 by gywon1
gywon1 replied the topic: Count the answers from 3 different arrays instantaneously
Dear Joffm,

Oh, yes. It works. Thank you so much. I forgot about this suffix and tried to use shown, but it doesn't work here :P
Thank you for your help, really appreciated.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!