Adding the value's of multiple checked checkbox answers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding the value's of multiple checked checkbox answers

gijsheesvan
Case: I have a checkbox with 3 answers (First / Second / Third) with values 1, 2, 3. I would like add the value's from the answers given in another field. Example: when the answers are "First" and "Third" I would like to get a total of "4" (1+3). When the answer is "First", "Second" and "Third" I would like to get a total of "6" (1+2+3).

Help would be truly appreciated!

Kinds regard,
Gijs
Reply | Threaded
Open this post in threaded view
|

Re: Adding the value's of multiple checked checkbox answers

Alessandro  Vernet
Administrator
Hi Gijs,

Assuming your multiple selection control is named "my-choices", you can compute the sum with:

sum(for $v in xxf:split($my-choices) return number($v))

And this is what it looks like:



You'll let me know if this is inline with what you were looking for,

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Adding the value's of multiple checked checkbox answers

gijsheesvan
Hi Alex,


Thanks so much for your answer! This was exactly the formula we where looking for. Thanks for that. Do you know if there is a site/ document with all (most used) possible formula’s? Because I had a hard time finding the answer on the internet / Orbeon Forum.

Kind regards,


Gijs

Op 29 apr. 2016, om 01:07 heeft Alessandro Vernet [via Orbeon Forms community mailing list] <[hidden email]> het volgende geschreven:

Hi Gijs,

Assuming your multiple selection control is named "my-choices", you can compute the sum with:

sum(for $v in xxf:split($my-choices) return number($v))

And this is what it looks like:



You'll let me know if this is inline with what you were looking for,

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet



If you reply to this email, your message will be added to the discussion below:
http://discuss.orbeon.com/Adding-the-value-s-of-multiple-checked-checkbox-answers-tp4661442p4661443.html
To unsubscribe from Adding the value's of multiple checked checkbox answers, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Adding the value's of multiple checked checkbox answers

Alessandro  Vernet
Administrator
Hi Gijs,

We have this:

http://doc.orbeon.com/form-builder/formulas-examples.html

And of course, just let us know if you think something should be added to this list.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet