Focal Point
Subtotal with where total

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

November 12, 2003, 09:57 PM
<Kristy>
Subtotal with where total
I am trying to create a Subtotal label that reads "Total For
England" or "Total for Germany" etc. It works fine until I use a
Where Total. In that case, it prints as "Total For" and does not
list the country. Here's some code that produces this. It works
fine when I take out the Where Total clause. Any ideas? THANKS!

TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY
COUNTRY
BY
CAR
BY
MODEL
ON COUNTRY SUBTOTAL
DEALER_COST
RETAIL_COST AS '*TOTAL FOR'
WHERE TOTAL ( DEALER_COST LT 8000 );
November 14, 2003, 07:36 PM
Victoria
Try removing the (). I use this quite often and it works fine, but I don't use the () with it. If not, can you post your error message?
November 17, 2003, 09:40 PM
Mikel
It seems that the only way to solve this is to include the subtotals in a customized subfoot.
SET PRINTPLUS=ON

DEFINE FILE CAR
TOTSTR/A40 = 'TOTAL FOR ' | COUNTRY ;
END

TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBFOOT
" WHERE TOTAL ( DEALER_COST LT 8000 );
ON TABLE SET STYLE *
TYPE=SUBFOOT, HEADALIGN=BODY, JUSTIFY=RIGHT, BACKCOLOR=SILVER, $
TYPE=SUBFOOT, ITEM=1, COLSPAN=3, JUSTIFY=LEFT, $
END
Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
December 24, 2003, 01:11 PM
GCohen
I didn't think anyone would know about
SET PRINTPLUS = ON .

It's a rare need, and was to prevent upward
compatible problems for focexecs that didn't expect to get the BY value in the text.

But, I think the default should be ON, and if there is a problem with an old routine, use
PRINTPLUS=OLD.