Focal Point
trying to produce a totals line

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

June 03, 2008, 11:33 AM
Tomsweb
trying to produce a totals line
I am trying to produce a totals line for each column in the report captioned below. I cannot
use RECAP, RECOMPUTE, SUMMARIZE as they will not produce fields that I can carry forward in a hold file for future in a program.

Here is the code...

TABLE FILE TF_PRREF2
HEADING CENTER
"ECT RATINGS REPORT"
"FOR &BEG1 - &END1"
"FOR FILE1 "
SUM
CNT.COUNTER AS 'CNT'
TOTANS
CORRECT
NA
WRONG
COMPUTE PRCT/I10 = (CORRECT/TOTANS)*100;
-*TTOTANS
-*TCORRECT
-*
-*COMPUTE GRADE/A1 = IF (PRCT GE 90) AND (PRCT LE 100) THEN 'A'
-* ELSE IF (PRCT GE 80) AND (PRCT LE 89) THEN 'B'
-* ELSE IF (PRCT GE 70) AND (PRCT LE 79) THEN 'C'
-* ELSE IF (PRCT GE 60) AND (PRCT LE 69) THEN 'F';
-*
BY REVIEWTYPE
BY MDDEPT NOPRINT
BY REVIEWED_MD
BY VSTART
BY VEND
BY VASOF
-*ON TABLE HOLD AS FILE1
END
-RUN
-GOTO OUTT
-*
-*
TABLE FILE FILE1
HEADING CENTER
"ECT RATINGS REPORT"
"FROM FILE1 "
PRINT
CNT
TOTANS
CORRECT
NA
WRONG
COMPUTE PRCT/I10 = (CORRECT/TOTANS)*100;
-*
BY REVIEWTYPE
-*BY MDDEPT
BY REVIEWED_MD
BY VSTART
BY VEND
BY VASOF
-*ON REVIEWTYPE RECOMPUTE AS ''
-*ON TABLE NTOTAL
-*ON TABLE HOLD AS FILE2
END
-RUN



REPORT Below:
?
RATINGS REPORT

REVIEWTYPE REVIEWED_MD VSTART VEND VASOF CNT TOTANS CORRECT NA WRONG PRCT
ECT 00369 2008/01/01 2008/03/31 2008/06/03 65 773 630 332 143 81
02981 2008/01/01 2008/03/31 2008/06/03 1 12 10 5 2 83
02984 2008/01/01 2008/03/31 2008/06/03 8 94 79 41 15 84
05800 2008/01/01 2008/03/31 2008/06/03 1 0 0 1 0 0
?

Thanks

Red Face


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
June 03, 2008, 05:09 PM
FrankDutch
Tom

please try to surround your code and examples with the following set of coes to make it better readable.

[ CODE] your text and code
[ /CODE]

But leave out the spaces after the [




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

June 05, 2008, 12:02 PM
Danny-SRL
Tom,
Is this what you are looking for?
REVIEWTYPE REVIEWED_MD VSTART VEND VASOF      CNT TOTANS CORRECT NA  WRONG PRCT  
00369      2008/01/01  2008/03/31  2008/06/03 65  773    630     332 143   81 
02981      2008/01/01  2008/03/31  2008/06/03  1   12     10       5   2   83 
02984      2008/01/01  2008/03/31  2008/06/03  8   94     79      41  15   84 
05800      2008/01/01  2008/03/31  2008/06/03  1    0      0       1   0    0 
99999                                         75  879    719     379 160  248


If so, try something along this line:
  
-* File tomsweb2.fex
TABLE FILE CAR
PRINT SALES RETAIL DEALER
BY COUNTRY BY CAR
ON TABLE HOLD AS TOM FORMAT ALPHA
END
FILEDEF TOM DISK TOM.FTM (APPEND
DEFINE FILE TOM
XCOUNTRY/A10='ZZZZZZZZZZ';
XCAR/A16=' ';
END
TABLE FILE TOM
SUM SALES RETAIL DEALER
BY XCOUNTRY BY XCAR
ON TABLE SAVE AS TOM
END
TABLE FILE TOM 
PRINT SALES RETAIL DEALER
BY COUNTRY BY CAR
END

This message has been edited. Last edited by: Danny-SRL,


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

June 05, 2008, 01:46 PM
j.gross
Note to Daniel's approach:

When applying it to your report, the compute
COMPUTE PRCT/I10 = (CORRECT/TOTANS)*100;
should be retained in the second request to correctly summarize the PRCT column.


- Jack Gross
WF through 8.1.05
June 06, 2008, 01:20 PM
Tomsweb
Thanks, thats it!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36