Welcome to the LimeSurvey Community Forum

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

URGENT: Count number of selected answer options in an array

  • jackuars
  • jackuars's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago - 6 years 1 month ago #163931 by jackuars
Q0. With what frequency do you use these social media platforms? (Array question)



I want to see if a user has selected atleast 3 social media platforms under "Several times a day" or "Once a day"

That is a user becomes a Elite Social media user if he has selected atleast 3 social media platforms under the options "Several times a day" or "Once a day"

I tried this under Q1 but it doesn't work.

Q1. Elite social media user (Yes/No hidden question): Default answer: Yes

count((Q0_1.NAOK == "1" or Q0_1.NAOK == "2"), (Q0_2.NAOK == "1" or Q0_2.NAOK == "2"), (Q0_3.NAOK == "1" or Q0_3.NAOK == "2"), (Q0_4.NAOK == "1" or Q0_4.NAOK == "2") >= 3)


The output shows Yes under Q1 if any social media platform is selected under the option "Several times a day" or "Once a day" else it shows N/A
Last edit: 6 years 1 month ago by jackuars.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #163947 by tpartner
You need to use sum(), not count().

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • jackuars
  • jackuars's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago #164050 by jackuars
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #164061 by tpartner
Clearly not very URGENT.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: holch
The topic has been locked.
  • jackuars
  • jackuars's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago #164062 by jackuars
Hi tpartner,

I had to dig in through the forums before I found the "sum" feature and was able to find it before you replied (luckily). But thanks for your help as always.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #164081 by holch

jackuars wrote: Hi tpartner,

I had to dig in through the forums before I found the "sum" feature and was able to find it before you replied (luckily). But thanks for your help as always.


That is great, but then the right thing to do would be post back here that you solved the problem and ideally show your solution. Otherwise you are wasting valuable time of posters here, that could already be spent on other issues, because yours was solved already. Just for the future. This forum is mainly run by volunteers who do this for free and in their spare time.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose