I have searched the board, and I think I know the answer, but I thought I would write a quick note to confirm if I am correct:

I have a node where volunteers will enter the number of hours of community service that they worked (hours_worked).

I have written a view that displays these nodes as a table, showing the date, user ID, and number of hours worked.

I would like to summarize the TOTAL hours_worked at the bottom of the report, which would represent the total sum of the hours_worked in all the nodes selected.

From my search, it appears that this isn't possible using the standard Views 2 settings, but would instead require custom PHP code to be written and installed. That's not something I am currently prepared to do, as I would like our site to be as "pure vanilla" code as possible.

Any feedback would be much appreciated!

Comments

karens’s picture

Status: Active » Fixed

That's exactly what Views Calc (http://drupal.org/project/views_calc) was designed to do. It has been ported to Drupal 6 and Views 2, but still needs more love as soon as I get time. It is basically working though.

misterlawrence’s picture

Thanks Karen! I've now installed Views Calc. I looked at the settings and I don't see a function that will do what I'm trying to accomplish.

Perhaps I'm just missing something (very likely!).

Just to be clear, here is what I am trying to do:

Node 1: hours_worked = 1000
Node 2: hours_worked = 3000
Node 3: hours_worked = 2500

I would like to write a View which shows a table with the above data, and underneath the table will be a sum of the total number of hours worked over the entire collection of nodes found (in this case, three nodes totalling 6,500 hours).

It would look something like this:

Peter Jones 1,000 hours
Sam Smith 3,000 hours
Mary Murphy 2,500 hours
Total Hours 6,500 hours

How can I do this (if it is possible)?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

misterlawrence’s picture

Status: Closed (fixed) » Active

Bump...anybody?

merlinofchaos’s picture

Project: Views (for Drupal 7) » Views Calc
Version: 6.x-2.1 » 6.x-1.x-dev

Sending over to Views Calc queue since it's questions about that.

eotinfotech’s picture

Title: Summary information such as subtotals » Any Updates ? Summary information such as subtotals

Hi,

I am also looking for the same solution for the Total at the bottom of table.
I already google alot and checked the views_calc. but unable to find the solution.

If any one got that, Kindly email me at info @ prachait . com

Thanks for your help.

Prachait

jeff h’s picture

As best I can tell, what *should* happen is:

* create your view
* under 'basic settings > style" choose "Views Calc Table"
* click the "cog wheel" beside this to change the style options
* tick one or more of the checkboxes in the "Column Calculations"

Unfortunately however, the end result of this was that the numbers were all wrong, so it doesn't actually work for me in a way that seems to be due to bugs, not incorrect configuration.

Hope this helps a little anyway.

Jeff

karens’s picture

Status: Active » Fixed

The instructions in #7 are correct and there were bugs. I've committed changes today that should get things working again. You'll need the -dev version with today's commits, so you'll have to either get it from cvs or wait until tomorrow to get the -dev tarball with the fixes.

eotinfotech’s picture

Title: Any Updates ? Summary information such as subtotals » Solution for this !

Hi,
We have found some solution to it !

We have created the custom theming for view and in that custom php code having variable will count / total and avg the data coming from the database

and then below to the report, we are showing the results

I had also tried the view_cal, but could not got any success, so i figure out the manual solution and it is working fine.

Prachait
http://eotinfotech.com

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.