row number: specifying the group when using "over group"

C

Coltrane04

I'm having a problem with row numbers in a report with three
groupings. The exact subject matter is a bit arcane, so as an example
I'll use taxi cabs. My question is simple: how do I get the desired
result (listed third below)? In other words, how do I specify the
group when asking for a running sum "Over Group"?

(The hypothetical data assumes as fixed-width font.)

Thank you,
Alec


-------------------- OVER ALL --------------------

Row | Day: Tuesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13567 13580
2 13580 13585

Total: 18

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
3 9721 9740
4 9740 9753

Total: 22

Row | Day: Wednesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
5 13585 13600
6 13600 13611

Total: 26

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
7 9753 9767
8 9767 9774

Total: 19

-------------------- OVER GROUP --------------------

Row | Day: Tuesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13567 13580
2 13580 13585

Total: 18

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
1 9721 9740
2 9740 9753

Total: 22

Row | Day: Wednesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13585 13600
2 13600 13611

Total: 26

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
1 9753 9767
2 9767 9774

Total: 19

-------------------- DESIRED --------------------

Row | Day: Tuesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13567 13580
2 13580 13585

Total: 18

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
3 9721 9740
4 9740 9753

Total: 22

Row | Day: Wednesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13585 13600
2 13600 13611

Total: 26

Driver: Bob
 
M

Marshall Barton

Coltrane04 said:
I'm having a problem with row numbers in a report with three
groupings. The exact subject matter is a bit arcane, so as an example
I'll use taxi cabs. My question is simple: how do I get the desired
result (listed third below)? In other words, how do I specify the
group when asking for a running sum "Over Group"?
-------------------- DESIRED --------------------

Row | Day: Tuesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13567 13580
2 13580 13585

Total: 18

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
3 9721 9740
4 9740 9753

Total: 22

Row | Day: Wednesday
------------
Driver: Alice
-------------
Odometer Start | Odometer Stop
---------------------------------
1 13585 13600
2 13600 13611

Total: 26

Driver: Bob
-------------
Odometer Start | Odometer Stop
---------------------------------
3 9753 9767
4 9767 9774

Total: 19


Use two running sum text boxes.

Add another one to the driver group footer section.

Then the detail
 
M

Marshall Barton

Whoops. Let's try that again.

Use two running sum text boxes.

Assuming the detail section running sum text box is named
txtLine.

Add an unbound text box (named txtGrpZ) to the day group
header section. Add a line of code to the day group header
section's Format event to initialize the text box's value:
txtGrpZ = 0

Now, add a text box (named txtGrpLine) to the driver group
footer section. Set its RunningSum property to Over Group
and its expression to:
=txtLine
Add a line of code to the driver group footer section's
Format event:
txtGrpZ = txtGrpLine

Finally, add another text box to the detail section. Use
the expression:
=txtGrpZ + txtLine
 
C

Coltrane04

What an ugly hack! Given my current frustration level, I'm just happy
that it works. Thank you.

-- Alec
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top