Welcome, Guest
Username: Password: Remember me

TOPIC: How to count number of multi choice boxes checked

How to count number of multi choice boxes checked 3 months 9 hours ago #107834

  • qsgt
  • qsgt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 1
Can someone please five me some code to count the number of multi choice check boxes that a user has checked. I have attached a copy of the question.

image.jpg


I would like to put in an equation that says something along the lines of you have selected to attend on x days. Where x is the number of selected dates.

Thanks
qsgt
Last Edit: 3 months 9 hours ago by qsgt.
The administrator has disabled public write access.

How to count number of multi choice boxes checked 2 months 4 weeks ago #107849

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
Hello,

Use the following snippet into an equation question type (just replace "QQ" by your correct multiple choice question code):
{count(that.QQ)}
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu, qsgt

How to count number of multi choice boxes checked 2 months 4 weeks ago #107868

  • qsgt
  • qsgt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 1
Hi,

OK thanks,

could you clarify some things for me:

If my question is in a different group do I have to include the group number? If so what format do I use? Because I want to count multiple check boxes what format do I use?

Thanks,
qsgt
The administrator has disabled public write access.

How to count number of multi choice boxes checked 2 months 4 weeks ago #107880

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
No, you don't have to include the group number... just beware that your multiple choice question code is unique in your survey...
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: qsgt

How to count number of multi choice boxes checked 2 months 4 weeks ago #107928

  • qsgt
  • qsgt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 1
Hi,

I have more that one question that is multiple choice I do I reference what question I want in the equation I have tried setting it up so that each subquestion has a different question but it just comes up as a syntax error.

Thanks very much for the help so far it is much appreciated.

qsgt
The administrator has disabled public write access.

How to count number of multi choice boxes checked 2 months 4 weeks ago #107932

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
Please import the attached sample survey and have a look... I hope it contains all expected answers to your question
Attachments:
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: qsgt

How to count number of multi choice boxes checked 2 months 4 weeks ago #107935

  • qsgt
  • qsgt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 1
When I try to import in file I get the following message:

This is not a valid LimeSurvey survey structure XML file.

Also is it possible to save the number outputted for use in another equation?

Sorry for the hassel,
qsgt
The administrator has disabled public write access.

How to count number of multi choice boxes checked 2 months 3 weeks ago #107938

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
Sorry, try with the new export...

You can reuse "{count(that.Q1)}", "{count(that.Q2)}" etc... wherever you want and manage all kind of mathematical operation. Results will be save automatically into the DB.

For example to sum the results (in a new equation):
{sum(count(that.q1))+(count(that.q2))}
Attachments:
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: qsgt

How to count number of multi choice boxes checked 1 month 3 weeks ago #109483

  • qsgt
  • qsgt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 1
Thanks a lot worked perfectly

qsgt
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.222 seconds
Donation Image