When ever we create a view for a list there will be a section called Totals. We can use this section to calculate & display the total of the items in the list. This will be useful to display totals particularly when you use group-by.If you notice, you will be seeing some column names with a drop-down nearby with option “Count”. If you select this the count will be based on this column. But if you are having a calculated column in your list, it will not be displayed here. So in this case we need to create a data view web part using designer. In this case you can do total and other operations like sum etc..
- First create a Data view web part and apply grouping if needed (check this post).
- Don’t forget to select “Show Group Footer” in the Sort & group properties.
Now you will get the data view displaying the list with totals for each group (as in above picture with count).- If you notice the code related to count is Count : <xsl:value-of select=”count($nodeset)” />
Now I am having another column Man Hours in my list which is of Type Number. I want t0 display the sum of man hours for each group (in my case for each location i need to find the total man hours).
To do so I just replace Count : <xsl:value-of select=”count($nodeset)” /> with Total Man Hours : <xsl:value-of select=”sum($nodeset/@Man_x0020_Hours)” />
Now my list view looks like
You can notice Total Man Hours displaying total man hours for each location. You can try more functions other than Sum







awesome dude , you have saved me today
awesome artical
Thanks Sridhar!!
You made my day.. wonderful way to explain the process.
Nice Post.
Can you sort the groups by Cont Value?
Best Regards and Thank you.
@Emmanuel – Hope It should be possible, again with some little tweaking in XSLT code
I can’t see the images. Is it possible to do it without Sharepoint Designer?
Kian,
You need to do it with Designer only.
can you do this for the calculated column :
I want to show sum of the calculated colum
Hi Chanakya,
I am new to Sharepoint and the company where I have started working with is using Sharepoint 2010. They have assigned me one task without any training. There is one list having columns title, comment, created (data type: date and time), status (values:assigned, submitted, completed and closed).
What I need is, grouping on list using columns Created (should be in MONTH YEAR format) and Status.
Eg : if Created column contains value 31/01/2012 then first it should be stored as January 2012 format and then grouping on this calculated column and then on Status column.
Please help me out in this.
Hi Shabana,
As I understand you just need a 2 level grouping that is possible out of box. Only thing you need to do is that creating a calculated column & get your date formatted as “January 2012″ and then you can apply grouping on this column. You can get the details of how to apply formulas for the calculated column here in this link..
http://msdn.microsoft.com/en-in/library/bb862071%28v=office.14%29.aspx
h
Check the “Date and Time formulas” section.
PS : Hope you could have achieved your requirement since its too long that u posted the comment. Apologies for the delayed reply. If replies are delayed in blogs, post your queries in MSDN so that you get immediate replies.
[...] Summing calculated columns in group by in Sharepoint list + Dataview webpart | Chanakya Jayabalan… [...]