Welcome to the LimeSurvey Community Forum

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

Sum of column for Array (numbers)

More
5 years 6 months ago #160765 by tixeon
I have a table using Array numbers and want to insert a row at the bottom that dynamically sums the column entries.





Is this possible?
The topic has been locked.
More
5 years 6 months ago #160768 by fvanderstarre
Hi, it's a bit counter-intuitive, but you have to define a question as Array-texts, and in Advanced Settings select "Numbers only". There you'll find options for totals (rows/columns/etc.).
The following user(s) said Thank You: DenisChenu, tpartner
The topic has been locked.
More
4 years 2 months ago #181494 by DerBibber17
Is there also a possibility to define a sum value like the "sum value equals" in multiple numerical input?

The totals of my columns should always be 100 and people shouldn't be able to move to the next question if the sum of every column is not 100.
The topic has been locked.
More
4 years 2 months ago - 4 years 2 months ago #181500 by Joffm
Hi,

what?

multiple numerical input?

use the option "maximum sum value" in "Input"

or

Sum of column for Array (numbers)

I'd recommend: question validation.

Read here:
manual.limesurvey.org/Expression_Manager....27that.27_variables
e.g. "What is the total of column 3? {sum(self.sq_3.NAOK)}"

Joffm

And: Please, no cross posts

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 2 months ago by Joffm.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
4 years 2 months ago #181505 by Joffm
Hi, Bibber,

in my opinion you should use an array(text) with setting "numbers only".
Here you can display the totals by setting


And with question validation like
(sum(self.sq_X001.NAOK)==100) and (sum(self.sq_X002.NAOK)==100) and (sum(self.sq_X003.NAOK)==100)
you can get this


Of course it has to be i,proved to not show the error text if there are still empty cells, etc.

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
The topic has been locked.
More
4 years 2 months ago #181568 by DerBibber17
That works perfect :) Thank you!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose