in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

whallify's blog

Wish I could display "totals" for a calculated field in a view...

So I have this “work blog” that I created for my team.  It's meant to be very simple for all the admins to put in what they've done, from the menial (added user to distro list) to the major (implemented SMS 2.0).  It has “entry”, “details”, Category (radio buttons) and importance (low/med/high).  It helps me do the weekly status reports.

An optional field is “minutes“.  I also have a caculated field which is minutes/60 so I can see estimated work hours. 

I also have three views -- one which is just “most recent first“, which functions like a normal blog, another view which is some details by employee, and another which is Work by category -- which would show about how much work hours done in the week, by category.

Problem is -- I can't do a “total“ by this calculated field.  I can only do it if I also display the minutes, and then total them up.  But I don't want minutes displayed, I want work hours, and that's the whole reason I created the calculated field.

Any workarounds?

Here are some sample pics:

Work Blog - Work by category

Work Blog - Most Recent First

 

Work Blog - By Employee

 

Comments

 

Wolfgeek said:

Here is a work-around to do totals (and subtotals when using Group By options in a standard list view with calculated fields.

Let's say we have a field called CALCULATED HOURS that is calculated as Round((([END TIME] - [START TIME])*24),1) (this gives the decimal notation of the total time rounded to the closest 10th).

Create a regular number field (not calculated) called HOURS.

Using Sharepoint Designer, create a workflow for your list that runs when list items are created and when list items are changed.

The workflow will have a single step.  Leave the condition field blank.  

In the action section, choose "Set field in the current item".

Click on the word "field" and choose HOURS.

Click on the word "value" and then click on "fx" to do a lookup.

Choose "current item" for the source.

Choose "CALCULATED HOURS" for the field.

Click Finish

Now whenever someone creates or modifies a  list item the non-calculated field will automatically be updated with the data from the calculated field.

Now you can display the non-calculated field in your standard list views, total by it, etc.

Hope that saves people the time it took me to figure it out! ;-)

March 13, 2008 9:05 AM
 

Roy said:

Thanks Wolfgeek.

I've tried your solution but the workflow gets stuck on 'started'.

I'm running it on a document library that enforces check-out (can't change this).

After waiting a long time I check in the document and the workflow changes to status 'stopped' and the field is not populated.

Any idea how I get around this?

June 9, 2008 10:37 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts