There is a defined column for Average of counts ("counts" is defined column having rownumber). As per the requirement, need to do SUM(AVE.COUNT) based on BY field.
When I do SUM(Count), its coming fine but not able to do sum on AVE.COUNT, is there any method to acheive sum up the AVG of Counts.
Could you please let me know , how to handle this ??
Thanks, SenthilThis message has been edited. Last edited by: <Kathryn Henning>,
8.0.04 Version Unix HTML,Excel
February 06, 2014, 11:06 AM
Dave
Senthill,
I think I know what you mean, but could post an example of what you're trying?
( You could always add an extra Row-counter and devide the sum by the number of rows... )
e.g.
DEFINE FILE CAR
ROWCOUNTER/I11 = 1;
END
TABLE FILE CAR
SUM SALES NOPRINT
ROWCOUNTER NOPRINT
COMPUTE AVG_SALES/D12.2 = SALES / ROWCOUNTER;
BY COUNTRY
END
_____________________ WF: 8.0.0.9 > going 8.2.0.5
February 07, 2014, 12:49 AM
Senthil
Dave , Here is the sample code, DEFINE FILE CAR Count/I5=1; MDEL_LEN/A50=CAR.CARREC.MODEL ||EDIT(CAR.SPECS.LENGTH); END TABLE FILE CAR SUM CAR.BODY.SALES AVE.Count AS 'AVE,Count' BY LOWEST CAR.ORIGIN.COUNTRY BY LOWEST CAR.COMP.CAR BY CAR.SPECS.MDEL_LEN NOPRINT ACROSS LOWEST CAR.BODY.SEATS ON TABLE SET PAGE-NUM NOLEAD ON TABLE ROW-TOTAL AS 'TOTAL' ON TABLE COLUMN-TOTAL AS 'TOTAL' ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=DATA, COLUMN=N4, BACKCOLOR='WHITE', $ TYPE=ACROSSVALUE, ACROSS=1, BACKCOLOR='WHITE', $ TYPE=REPORT, COLUMN=N3, SQUEEZE=1.416667, $ ENDSTYLE END
DEFINE FILE CAR
Count/I5=1;
MDEL_LEN/A50=CAR.CARREC.MODEL ||EDIT(CAR.SPECS.LENGTH);
END
TABLE FILE CAR
SUM
CAR.BODY.SALES
Count
-*AVE.Count AS 'AVE,Count'
BY LOWEST CAR.ORIGIN.COUNTRY
BY LOWEST CAR.COMP.CAR
-*BY CAR.SPECS.MDEL_LEN
ACROSS LOWEST CAR.BODY.SEATS
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=DATA,
COLUMN=N4,
BACKCOLOR='WHITE',
$
TYPE=ACROSSVALUE,
ACROSS=1,
BACKCOLOR='WHITE',
$
TYPE=REPORT,
COLUMN=N3,
SQUEEZE=1.416667,
$
ENDSTYLE
END
_____________________ WF: 8.0.0.9 > going 8.2.0.5
February 07, 2014, 08:25 AM
Senthil
quote:
BY CAR.SPECS.MDEL_LEN
Thanks for your reply ,
I need to include the commented BY field as well to retrieve the required results
CAR.SPECS.MDEL_LEN
PLease suggest how to acheive to get it with the BY field ??
Thanks, Senthil.
8.0.04 Version Unix HTML,Excel
February 07, 2014, 10:22 AM
Dave
Senthill,
That will change the outcome of the SUM for each row. Even with NOPRINT.
If you need the SUM values on each row independent of the commented By-Field you might want to add it later ( with MATCH for example ) or use sort-groups.
G'luck.
( I'm still trying to understand want the desired functionality is ).