Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Count the answers from 3 different arrays instantaneously

  • gywon1
  • gywon1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #158683 by gywon1
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.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #158687 by Joffm
Hello, gywon1,
correct, it cannot calculate, because there are still some missing fields.
This is normal behaviour.

You have to use "NAOK".
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
The following user(s) said Thank You: DenisChenu, tpartner
The topic has been locked.
  • gywon1
  • gywon1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #158707 by gywon1
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.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose