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
BY NAME NOPRINT
BY REG NOPRINT
BY SUBR NOPRINT
BY RMD_YR NOPRINT
BY RMD_DT NOPRINT
BY SLS NOPRINT
BY SLD_Q NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD1
When i run the code,I will get the report as shown below :
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
I see that this is being addressed in the duplicate topics, so I'll mark this topic as [CLOSED].
|Powered by Social Strata|