Focal Point
total on by field

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

April 04, 2007, 06:22 PM
Usernani
total on by field
Is there a way to get a total on By field?
thanks
April 04, 2007, 06:36 PM
susannah
you can make a dummy byfield to sort by, just to sort by, leaving your data field to appear in the report and be summed as usual
DEFINE FILE CAR
BYFIELD/I8=SALES;
END
TABLE FILE CAR
SUM SALES WEIGHT SEATS
BY HIGHEST BYFIELD NOPRINT
BY COUNTRY BY CAR
ON TABLE SUMMARIZE
END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 05, 2007, 07:36 AM
Danny-SRL
Please note the difference when your TABLE command uses PRINT or SUM.
-* Example 1: PRINT
TABLE FILE CAR
PRINT SALES RCOST DCOST
BY COUNTRY
BY HIGHEST SALES NOPRINT
BY CAR
ON COUNTRY SUB-TOTAL
END
-*
-* Example 2: SUM
TABLE FILE CAR
SUM SALES RCOST DCOST
BY COUNTRY
BY HIGHEST TOTAL SALES NOPRINT
BY CAR
ON COUNTRY SUB-TOTAL
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 05, 2007, 09:57 AM
Usernani
Thanks, but since I have two sort group, I could not have the the print field in my sort group, I want to get a total on "BDGT_AMT" as well as on "RMNG_AMT"
Thanks,

TABLE FILE FI_BDGT_MAIN_INFO
SUM
ITEM_TOTAL_PRCH_COST_AMT AS 'TOTAL_SPENT'
BY CPTL_GRP_CD
BY CPTL_ITEM_CD
BY BDGT_AREA_TXT
BY BDGT_PROJ_TXT
BY BDGT_AMT
BY EXPN_GRP_TXT
SUM
ITEM_TOTAL_PRCH_COST_AMT AS 'TOTAL_SPENT'
BY CPTL_GRP_CD
BY CPTL_ITEM_CD
BY BDGT_AREA_TXT
BY BDGT_PROJ_TXT
BY BDGT_AMT
BY EXPN_GRP_TXT
BY TOTAL COMPUTE RMNG_AMT/D20.2 = BDGT_AMT + SUM.ITEM_TOTAL_PRCH_COST_AMT;
April 05, 2007, 11:48 AM
mgrackin
Usernani,

It seems like, with the sample you provided, you have a fixed number (BDGT_AMT) which you do not want to SUM but you want to subtract the total of the purchases.

Here's an example doing something with the CAR file. I have a fixed number (QUOTA) from which I want to subtract the total sales and display the difference in a SUBFOOT/SUBTOTAL line.

I hope this helps.

DEFINE FILE CAR
QUOTA/D12=40000;
END
TABLE FILE CAR
SUM MAX.QUOTA AS 'QUOTA' NOPRINT
SALES AS 'COUNTRY,SALES' NOPRINT
COMPUTE QUODIF/D12=C02-C01; NOPRINT
COMPUTE QUOFLG/A1=IF (QUODIF LT 0) THEN 'N' ELSE 'Y'; NOPRINT
BY COUNTRY
SUM SALES AS 'MODEL,SALES'
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBFOOT
"Country Quota:ON TABLE SET STYLE *
TYPE=TITLE,BACKCOLOR=NAVY,COLOR=WHITE,$
TYPE=DATA,BACKCOLOR=TEAL,COLOR=WHITE,$
TYPE=SUBFOOT,HEADALIGN=BODY,BACKCOLOR=YELLOW,COLOR=BLACK,$
TYPE=SUBFOOT,LINE=1,OBJECT=TEXT,STYLE=BOLD,JUSTIFY=LEFT,$
TYPE=SUBFOOT,LINE=1,OBJECT=FIELD,STYLE=BOLD,JUSTIFY=RIGHT,$
TYPE=SUBFOOT,LINE=1,ITEM=4,BACKCOLOR=RED, COLOR=WHITE,JUSTIFY=RIGHT,
WHEN=QUOFLG EQ 'N',$
TYPE=SUBFOOT,LINE=1,ITEM=4,BACKCOLOR=GREEN,COLOR=WHITE,JUSTIFY=RIGHT,
WHEN=QUOFLG EQ 'Y',$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011