Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting a running totals column

Status
Not open for further replies.

antmoe3

Programmer
Feb 24, 2006
32
US
I need help with counting numbers in a column after running total is calculated. How would I get the results to show like (C ) below?


A) DATA
Dept Color
10 Blue
10 Blue
10 Blue
10 Red
11 Blue
11 Blue
11 Green
12 Green


B) Running Total on Number of Orders
Dept Color Number of Orders
10 Blue 3
10 Red 1
11 Blue 2
11 Green 1
12 Green 1


C) Count of the Number of Orders of the running total By Color

Dept Color Number of Orders
10 Blue 3
10 Red 1
Sub-Total-10 4

11 Blue 2
11 Green 1
Sub-Total-11 3

12 Green 1
Sub-Total-12 1
 
You don't need running totals for this. Instead, insert a group on department and then a second group on color. Then select any non-null field in the detail section and insert a count at the color group level, and then a second time, on the department group level.

-LB
 
The running total have formulas assoicated. So with that, how do I count the numbers in a column after running total is calculated.
 
You'll need to somehow repeat the function of the running totals at a higher level: i.e. running totals that count for the entire column.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Yes, you will need two running totals. First insert the groups on department and color. Then create a running total
with an evaluation formula like:
(
onfirstrecord or
{table.color} <> previous({table.color})
) and <your formula>

...which resets on change of department. Use this for the color group footer. Then create a running total that evaluates based on a formula without hte color condition, and resets on change of group (dept) for the the department group footer.

For further help, you should provide the specifics of your running total, including the evaluation formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top