Let's Get Social!
Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Unable to calculate average on an across field.Need help.
 Go New Search Notify Tools Reply
 [CLOSED] Unable to calculate average on an across field.Need help.
Member
 posted June 12, 2013 01:44 PM
Hi,

I have a table file and I need to do an average on the across field XYZ as shown in the code below.

TABLE FILE HOLDDP
SUM
CNT.DP
BY ID
BY NAME NOPRINT
BY REG NOPRINT
BY SUBR NOPRINT
BY RMD_YR NOPRINT
BY RMD_DT NOPRINT
BY SLS NOPRINT
BY SLD_Q NOPRINT
ACROSS XYZ
ACROSS ABC
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD1
END
-RUN

When i run the code,I will get the report as shown below :
ID XYZ AVG
_________________________
AAAA 12 05 06
BBBB 05 20 15
CCCC 15 13 09

My average Calculation is something like this :
Average = ((12*5)+(05*4)+(06*3))/(12+5+6).
Finally I need to display the average value in the average column beside the XYZ field.

Could anyone tell me how to do this.Any help is greatly appreciated.

Thanks a lot!

This message has been edited. Last edited by: <Kathryn Henning>,

webfocus 769,windows 7,html

 Posts: 24 | Registered: July 16, 2010 IP
Expert
 posted June 12, 2013 01:45 PM Hide Post
Why do you have three posts asking what looks like the same question?

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

 Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005 IP
Expert
 posted June 12, 2013 01:45 PM Hide Post
I mean four.

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

 Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005 IP
Virtuoso
 posted June 12, 2013 01:45 PM Hide Post
Same question!

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

 Posts: 1954 | Location: Tel Aviv, Israel | Registered: March 23, 2006 IP