5

I am struggling to get a running sum to work on a report. What I want is the following:

Product    Qty1   Qty2  Total  RunningTotal
ABC123     100    200   300    300
DEF321     50     100   150    450
XYZ123     -100   -150  -250   200

The total column is an expression like

=ReportItems!Qty1.value + ReportItems!Qty2.Value

For running total I have tried many different things, most of which tell me that it has to be in a header or footer. The obvious expression which I thought would work is

=ReportItems!Total.Value + previous(ReportItems!Total.Value)

but that doesnt work.

Can anyone explain what I am doing wrong here?

Cheers Dean

Dean Harry
  • 277
  • 1
  • 3
  • 13
  • Does no-one know how to do this? – Dean Harry Jun 03 '12 at 04:05
  • Maybe you could calculate running totals in the underlying query instead and supply ready values to the report. Try searching this site for running totals in SQL for the specific SQL product you are using. (Although you seem to have two of them, MySQL and SQL Server, as per your tags, in which case you might need to search for solutions for both.) – Andriy M Jun 03 '12 at 04:36

1 Answers1

7

I believe you're looking for the RunningValue function. Untested, but something like:

=RunningValue(Fields!Total.Value,Sum,"MyGroupName")
lc.
  • 113,939
  • 20
  • 158
  • 187