2

I created a webform in drupal, and added a grid component in it. The grid has 13 questions and 3 options (good, bad, terrible). It's like a poll and people come and answer the questions.

In results, I already have the sum for each option in each question. What I also need is the sum for each option for all questions togehter. For example I need a sum row in grid footer!

I tried webform submissions in views, but it does not give me the data stored in grid.

Be aware that I'm noob in PHP and I don't know how to make TPL files.

image in this link says it all: i need sum row in grid footer

thanks

1

Create a 'webform submission' view. By using the Views Calc module you can display the sum of each field at bottom of the table/grid.

This module adds simple calculations to a views table. Requires the Views module.

You can SUM, AVERAGE, COUNT, MIN, MAX, or AVG selected columns. A plug in theme makes the view look more spreadsheet-like (right justifies numeric fields, shades calculated columns and rows, and underlines calculated rows).

Image from module page

enter image description here

0

The answer as suggested by Krishna Mohan is indeed a valid approach, here are some more suggestions to further enhance it.

The table in the OP is similar to this one:

enter image description here

The Views Calc module can be used to transform that table so that the calculations in the last rows (with Count, Sum and Max) get added to it (as shown in the answer as suggested by Krishna Mohan).

By replacing the columns '# Fish', 'Weight' and 'Big Fish' with 'good', 'bad' and 'terrible' (as in the question), and by asking for only the 'sum' to be added, it should answer the question I think, no?

To ask for the 'sum', just select it from the selection list, similar to what is shown in this screenshot:

enter image description here

For more details (step-by-step instructions), refer to the community documentation about the Views Calc module.

Disclosure: I'm a co-maintainer (not owner ...) of this module,
I hope this does not violate the site's policy on self-promotion.

0

If you would like to sum every column, the alternative module that you can use is Views Aggregator Plus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.