Search code examples
sharepoint-2010sumreportinfopathreportbuilder

Sum data in a column based on another column Report Builder - Sharepoint


I have a project where I have to report stop times of different production lines. I have to make a report file with Report Builder and my problem for the moment is that I have to sum all the stop times that where entered for the same line.

The stop times are entered on SharePoint (using a form from InfoPath) and stored in a SharePoint List.
My data list is presented like this:

LINES ---- TIME(min)
Line 1 ---- 4
Line 2 ---- 2
Line 1 ---- 3
Line 3 ---- 8
Line 4 ---- 9
Line 2 ---- 2
Line 3 ---- 4
Line 5 ---- 5
Line 5 ---- 8

I want to sum all the stop time for each line (In my report generated with Report Builder). So I'll have "Line1 -> 7", "Line 2 -> 4",... Do you have any idea how I could do it? Ask if you need more informations...

Thank you for your help!


Solution

  • This should be fairly easy; set up a table drawing the data in exactly that format, then right click the "Details" row in "Row Groups" at the bottom of Report Builder and click "Group Properties". Press Add, and select your "Lines" field, then press OK. Finally, change the expression populating the "Time" column in your table to =SUM(Fields!.Value).

    What this will do is collapse the table to show one line per distinct value it finds in the "Lines" column, then tells it to simply add all the values it collapses together. The effect will be that it sums up the Time column for each distinct value it finds in the Lines column.