Sum of column for Array (numbers)

More
1 year 8 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?
Attachments:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 year 8 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

Please Log in or Create an account to join the conversation.

More
4 months 1 week 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.

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago - 4 months 1 week 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:
https://manual.limesurvey.org/Expression_Manager#The_reserved_.27this.27.2C_.27self.27.2C_and_.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 months 1 week ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
4 months 1 week 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
Attachments:
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #181568 by DerBibber17
That works perfect :) Thank you!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!