SSRS Running Total

Cool. That's useful. Thanks!

Joe

How do you calculate a running total in SSRS?


I have a BAQ that has payroll hours and labor hours, at the end of the report I want to do a sum of both payroll hours and labor hours.  For labor hours i have no problems, but for payroll hours, the value can be duplicated if an employee worked on multiple jobs at the same time.


In Crystal Reports I would have just done a running total, where the labor hours are summed every time the laborhed.laborseq field changed.  How can I do this in SSRS?

You can add a new tablix at the bottom with the same dataset and same groups/breaks, and then delete the detail lines. You should wind up with your subtotals and report totals at the bottom of the report.

If I want to do page breaks between groups (like to pass out to sales reps), I insert a blank, small rectangle before the total and attach a page break to it.

I don't know if you can just duplicate the original tablix. That would be easier.

Or something like that.

Joe Trent

--
Joe D. Trent
Bigham Ag Equipment

You can do an expression and use the RunningValue Function. The syntax is RunningValue(expression, function, scope)

 

Here’s an example.

 

=RunningValue(Fields!EstProdHours.Value,sum,"OpCode2")

 

The Expression is typically the field you’re working with, you’ll probably want to “sum” and the Scope is the name you have your row group.

 

Below is a sample of what you might want to use since you might want to do an IFF to check for a condition.  Below I’m comparing 2 fields, and if they match it’s taking the value of another field and adding it to the running total.  Otherwise if the fields don’t match the value it will set the value of that record to 0.

 

=RunningValue(IIF(Fields!OprSeq.Value = Fields!RelatedOperation.Value , Fields!Total_Lines.Value, 0), Sum,"OpCode")

 

 

See screenshot for placement of where the expression would go on a report I did.

 

https://onedrive.live.com/redir?resid=BC5CC0382064AE87!970&authkey=!AGcARIP3CuvMC4k&v=3&ithint=photo%2cpng

 

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, May 3, 2016 7:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] SSRS Running Total

 

 

How do you calculate a running total in SSRS?

 

I have a BAQ that has payroll hours and labor hours, at the end of the report I want to do a sum of both payroll hours and labor hours.  For labor hours i have no problems, but for payroll hours, the value can be duplicated if an employee worked on multiple jobs at the same time.

 

In Crystal Reports I would have just done a running total, where the labor hours are summed every time the laborhed.laborseq field changed.  How can I do this in SSRS?