Welcome to the LimeSurvey Community Forum

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

Sum of column for Array (numbers)

  • tixeon
  • tixeon's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 5 months ago #160765 by tixeon
Sum of column for Array (numbers) was created 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
6 years 5 months ago #160768 by fvanderstarre
Replied by fvanderstarre on topic Sum of column for Array (numbers)
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
5 years 1 month ago #181494 by DerBibber17
Replied by DerBibber17 on topic Sum of column for Array (numbers)
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.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago - 5 years 1 month ago #181500 by Joffm
Replied by Joffm on topic Sum of column for Array (numbers)
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: 5 years 1 month ago by Joffm.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #181505 by Joffm
Replied by Joffm on topic Sum of column for Array (numbers)
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
5 years 1 month ago #181568 by DerBibber17
Replied by DerBibber17 on topic Sum of column for Array (numbers)
That works perfect :) Thank you!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose