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 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.
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?