Focal Point
How to get the AVE to appear on the total column

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

June 26, 2007, 01:52 PM
Adolf Mergulhao
How to get the AVE to appear on the total column
TABLE FILE CAR
SUM
DEALER_COST
AVE.DEALER_COST
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL AS '*TOTAL COUNTRY'
END

I am trying to display the avarage in the total column any ideas


Webfocus 7.6.2 on Windows Enterprise 2003 Server and
Webfocus 7.6.2 on HP Unix Server
June 26, 2007, 02:17 PM
<Emily Duensing>
Try:

TABLE FILE CAR
SUM
DEALER_COST
AVE.DEALER_COST
CNT.DEALER_COST NOPRINT
BY COUNTRY
BY CAR
ON TABLE RECAP
TOT_AVG_DC\D12.2=DEALER_COST / CNT.DEALER_COST;
ON TABLE SUBFOOT
"TOTAL END

I believe that will get you to the number you want... formatting is up to you!
June 26, 2007, 02:23 PM
Francis Mariani
Look for "Manipulating Summary Values With Prefix Operators" in the manual.

An example (that works???):

DEFINE FILE CAR
DC/D7 = DEALER_COST;
END
TABLE FILE CAR
SUM
DEALER_COST AS 'DEALER,COST'
AVE.DC      AS 'AVERAGE,DEALER,COST'
BY COUNTRY
BY CAR
ON COUNTRY RECOMPUTE SUM. DEALER_COST AVE. DC AS '*TOTAL COUNTRY'
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 26, 2007, 02:53 PM
Darin Lee
you can also use prefixes in the sub-total:
 
SET SUMMARYLINES=NEW
TABLE FILE CAR
SUM DEALER_COST RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE SUBTOTAL
AVE. DEALER_COST
SUM. RETAIL_COST
END
 



Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 26, 2007, 03:12 PM
Francis Mariani
Unfortunately, the example you cite from the manual is a simplistic one and will not work if the Average is done on a field which is also being summed, naming the field twice, once without a prefix operator and once with a prefix operator messes up the subtotal/summarize/recompute.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 26, 2007, 03:48 PM
Leah
I think this works

TABLE FILE CAR
COUNT MODEL NOPRINT
BY COUNTRY
BY CAR
SUM
DEALER_COST
COMPUTE
AVCOST = C2 / C1;
BY COUNTRY
BY CAR
ON COUNTRY RECOMPUTE
END


Leah
June 26, 2007, 03:52 PM
Darin Lee
right. I wasn't using the same column twice. if you need both the sum and the average of the same column, you can DEFINE/COMPUTE another field with a different name. (the SUM. is optional. If omitted, SUM is the default operation)


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 27, 2007, 10:04 AM
ira
try using subfoot
and in the subfoot use:


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
June 27, 2007, 10:05 AM
ira
quote:
subfoot

try using in the subfoot
double quote left caret ave.fieldname double quote

Ira


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0