0

i have a content-type "participants" with a field "number".

i want to calculate the total of all the values that are inserted in all the "participants"-node.

ie:

Node 1 -> 200 participants Node 2 -> 3 participants Node 3 -> 15 participants

Total: 218

Only the result should be visible

I was thinking to do it with views, but i'm not succeeding.

Any suggestions?

  • Where are you wanting to output this value? – thumbson Feb 13 '15 at 3:41
  • it should be displayed in a block, value only – jimi Feb 13 '15 at 8:01
1

Use views calc to achieve this behaviour, This module adds simple calculations to a views table: https://www.drupal.org/project/views_calc

| improve this answer | |
0

Also you can have a look at this module

https://www.drupal.org/project/nodeviewcount

Node View Count module allows to count node views. Unlike statistics module, this module records each view of node with user uid and timestamp. So now you can know how many times a user viewed node by day, week, month and etc.

This module is integrated with Views module. You can use it to create different statistics pages, output new not viewed nodes for user and many more.

hope this helps :)

| improve this answer | |
0

Views should be able to do this out of the box.

Create a block display showing fields and under your "Other" options, enable "Use Aggregation."

Add your field ("number"), select aggregation type "SUM" with your Group Column as "Value." In the next form set your label to Total. The key here is to not have a sort criteria. Filter by your content type "participants" and this should give you what you're looking for.

| improve this answer | |

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.