Running Total based on Parameters

Hi Experts,

I have a field that is a summary of   fields...

@TempQtyOnHand = {QtyOnHand} + {InTransit} - {GrossRequired} and placed at the Detail

The report allows multiple values in the Parameter... This report is then grouped on this
parameter

What I need to do is create a RunningTotal on the @TempQtyOnHand field and have it continue to run through each Detail and never reset...

Parameter Value:0001
QtyonHand        GrossRequired    In Transit
Record1         100                       1000                        20
Record2         30                           80                           10
Record3         50                           100                         40
Record4         10                             2                            5

----------------------------------------------------------------------------------------

Parameter Value:0002

In this 2nd Parameter Value...the {QtyonHand} becomes a '1stCalculated' field based on {QtyOnHand} + {InTransit} - {GrossRequired}  from the Values in the 1st Parameter Value..

The '2ndCalculatedField '  is a summary of '1stCalculatedField'-GrossRequired

1stCalculatedField      GrossRequired           2ndCalculatedField
Record1         -880                                  1000                                120
Record2         -40                                      80                                   40
Record3         -10                                    100                                   90
Record4         13                                       2                                      11

There could be up to 20 Values entered into the Parameter Field..

The 1stCalculatedField and 2ndCalculatedField are essentially running totals that will never reset...

Record1, Record2, Record3, Record4 will always be the same regardless of how many values are in the Parameter Field... Could be 30 records per group
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
A record can only appear in one group and if I understand what you want is really a series of reports based on the parameter values.

Do I understand the problem?

Grouping is based on values in records not the values of a parameter.  You can use parameters to control how a report is grouped by specifying which field the report is grouped on but you can provide a parameter with 2 values and expect to get 2 groups.

A record is always in a group but it cannot be in more than one group.

Consider a class of students.  You have A students, B students, etc.  A student can be a in the A group on one test and in the B group based on a second test but he can't be in both groups based on 1 test or  a collection of tests.

Will the parameter values always be in order?
For instance the values 0001, 0002, 0003 would specify 3 different grouping and 3 different sets of calculations.

Can the order be 0002, 0001, 0003?
If they will always be in order you could have as many subreports as desired on the report and have each be shown or suppressed based on the values in the parameters.

mlmcc
Author Commented:
The parameter values will always be in order...'series of reports based on parameter values' sounds like you understand the problem
Commented:
I think the subreport idea is the only way to get this to work.

Create each report you want to see.
Create a new report
Create multiple detail sections
Drop a subreport into each in the order you want to see them.
One subreport per detail section
You can then suppress the detail sections with formulas like
'0001' IN {?YourParameter}

mlmcc

Experts Exchange Solution brought to you by