Focal Point
SUM or SUBTOTAL in SUBFOOT

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2851009331

October 10, 2005, 02:30 PM
<Gabbar>
SUM or SUBTOTAL in SUBFOOT
Hi,

I have the following scenario.

TABLE FILE FILE1
SUM
COUNT1
BY
SORT1
BY
SORT2
BY
SORT3
BY
SORT4
WHERE ....
END

Now I need to display Sub-Total for SORT2 and SORT3 fields in the SUBFOOT of the same. i.e.

SORT1 SORT2 SORT3 SORT4 COUNT1
A1 B1 C1 D1 100
D2 200
D3 300

************************ TOTAL C1 600 ***** (SUBFOOT ON SORT3)

C2 D1 400
D7 100
************************ TOTAL C2 500 *****

************************ TOTAL B1 1100 ****
(SUBFOOT ON SORT2)

Kindly provide any leads about what code I need to add in either SUBFOOT label or somewhere else to achieve the desired display.
October 10, 2005, 02:55 PM
Leah
If all you want is a subtotal at that level and not at other levels then

ON SORT3 SUBTOTAL AS 'TOTAL'

This however subtotals all values (of course you only have one COUNT1 - however you do have other fields I see). It appears though that you want the total to print in between your detail line information.

You can do subfoots as the sort values change
ON SORT3 SUBFOOT
"****************TOTAL <SORT3 <ST.COUNT1"
ON SORT2 SUBFOOT
"****************TOTAL <SORT2 <ST.COUNT1"

The subfoots would print on the appropriate break, but if you want the other fields in between hopefully someone out there has accomplished this, or is it just the way you presented your data?
October 11, 2005, 03:05 PM
Noreen Redden
You might not even have to do a SUBFOOT at all. Try this:
ON SORT3 SUB-TOTAL
You will then get:
TOTAL SORT3 C1 600
...
TOTAL SORT3 C2 500
TOTAL SORT2 B1 1100

If however, you want a particular layout, then the SUBFOOTs as above.