Board index » delphi » Calculating Detail Field Based On Group Sum

Calculating Detail Field Based On Group Sum

My report is based on a single dataset which is ordered by <groupfield>,
and contains a group header, a detail, and a group footer band, producing
output like this:

Department 1
     Joe           10
     Bob            5
                   -------
           Sub    15
Department 2
    Carol          8
    Sue            2
                  -------
          Sub    10

The Department is in group header,  individuals are in detail,
and the subtotals (reset after print) are in group footer.  I would like to
add a column in the detail band that calculates a value based on the
'SubTotal' in the group footer - something like this:

Department 1
     Joe     10        (10/15)
     Bob      5        (5/15)
             -------
      Sub   15

In other words, calculate what percentage of Department 1's subtotal (in
this case, 15) for each detail record.  

How do I build this expression?????

 

Re:Calculating Detail Field Based On Group Sum


John
i think you'll need to pull in an extra query in wich you would total the
'group' and then in the afterprint of the detail edit a label so it gets
printed with the right contents
cu
marc

Quote
John Nordyke wrote in message

<01be13d2$7b5ffa20$6522a...@jnord.ag.cyanamid.com>...
Quote
>My report is based on a single dataset which is ordered by <groupfield>,
>and contains a group header, a detail, and a group footer band, producing
>output like this:

>Department 1
>     Joe           10
>     Bob            5
>                   -------
>           Sub    15
>Department 2
>    Carol          8
>    Sue            2
>                  -------
>          Sub    10

>The Department is in group header,  individuals are in detail,
>and the subtotals (reset after print) are in group footer.  I would like to
>add a column in the detail band that calculates a value based on the
>'SubTotal' in the group footer - something like this:

>Department 1
>     Joe     10        (10/15)
>     Bob      5        (5/15)
>             -------
>      Sub   15

>In other words, calculate what percentage of Department 1's subtotal (in
>this case, 15) for each detail record.

>How do I build this expression?????

Other Threads