Focal Point
Do not print when subtotal LT 15000

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

March 25, 2005, 01:29 PM
webfocuspgm
Do not print when subtotal LT 15000
How do you control printing based upon the value of the subtotal....?

TABLE FILE CAR
PRINT
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
BY CAR
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
ON CAR SUBTOTAL SALES
END

Total for Audi is 7800
Total for BMW is 80390

I want only BMW to print ...... ?

Thanks
March 25, 2005, 02:05 PM
dwf
ON CAR SUBTOTAL SALES WHEN SALES GE 15000;
March 25, 2005, 02:38 PM
webfocuspgm
I gave it a try but it still printed detail for both AUDI and BMW and then the subtotal for BMW. Which makes since.... I told it to print and then only print the subtotal when the subtotal is greater than.....

What I really want is AUDI not to print at all - no detail and no subtotal.....

thanks for the info .... I'll use it to try a few other things.....
March 25, 2005, 02:58 PM
webfocuspgm
Ends up a two part process - Unless someone else offers an easier way...

TABLE FILE CAR
SUM
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
BY CAR
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
WHERE SALES GT 15000
ON TABLE HOLD AS HOLDCAR
END
TABLE FILE HOLDCAR
PRINT
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
BY CAR
BY COUNTRY
ON CAR SUBTOTAL
END

Thanks
March 25, 2005, 03:09 PM
Leah
Does this give what you want?
TABLE FILE CAR
PRINT
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
BY CAR
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
ON CAR SUBTOTAL SALES
WHERE TOTAL SALES GT 15000
END
March 25, 2005, 07:06 PM
mgrackin
I believe this is what you are looking for. Since you are looking to view detail (PRINT) but would like to eliminate based on total (SUM) sales, you need to do a multiverb request.

DEFINE FILE CAR
NEWSALES/D12.2=SALES;
END
TABLE FILE CAR
SUM NEWSALES NOPRINT
BY CAR
BY COUNTRY
PRINT
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
BY CAR
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
WHERE TOTAL NEWSALES GE 15000
ON CAR SUBTOTAL SALES
END
March 25, 2005, 07:11 PM
mgrackin
Just to elaborate on the code I posted, the reDEFINE of sales is necessary because FOCUS always picks the most detail (right most) version of a field if it appears more than once. Since sales would appear in the SUM statement and the PRINT statement, the TOTAL test would be applied to sales from the PRINT statement which doesn't give you what you are looking for. Hence the need to differentiate between the aggregated sales (newsales) and the individual values of sales. Then the WHERE TOTAL test is applied to NEWSALES.
March 27, 2005, 01:27 PM
<JG>
Try the following

TABLE FILE CAR
PRINT
MODEL
BODYTYPE
DEALER_COST
RETAIL_COST
SALES
COMPUTE ACCCSALES/D12.2=IF COUNTRY EQ LAST COUNTRY AND CAR EQ LAST CAR THEN SALES+LAST SALES ELSE SALES; NOPRINT
BY CAR
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
ON CAR SUBTOTAL SALES WHEN ACCCSALES GT 10000;
END