Hi All, i am using proc report to calculate percentages. however the result is incorrect when it comes to the 'Total' rows that are generated by using the below code: i am including part of the result where the %MET column is giving incorrect percentages for those rows where it is calculating total for rows. eg 1806/2099 should be 86%. but it is showing 80% . i have added the last column manually to show the differences in certain rows. Kindly provide suggestion how to correct that. proc report data=ByProduct missing;
title 'By Product;
columns Product Request_Type Total_Closed_SRs MET MISSED PCT_METSLA ;
define Product/group 'Product';
define Request_Type/group 'Request_Type';
define Total_Closed_SRs/display analysis sum 'Total_Closed_SRs';
define MET/display analysis sum 'Met_SLA';
define MISSED/display analysis sum 'Missed_SLA';
define PCT_METSLA/display analysis mean f=percent8.2 '%METSLA';
break after Product / summarize;
rbreak before / summarize style =[background=lightblue font_weight=bold];
compute after product;
product = 'Total';
endcomp;
rbreak before / summarize style =[background=lightblue font_weight=bold];
compute before;
Product='Overall';
endcomp;
run;
Product Request_Type Total Met Missed %MET Overall 2099 1806 293 80% 86% product A x 4 3 1 75% 75% xxxx 3 3 0 100% 100% xxxxx 3 2 1 67% 67% xxxxxx 4 4 0 100% 100% Total 14 12 2 85% 86% product b x 26 26 0 100% 100% Total 26 26 0 100% 100% product c x 2 2 0 100% 100% xx 31 22 9 71% 71% xxxx 1 1 0 100% 100% xxxxx 14 9 5 64% 64% Total 48 34 14 84% 71%
... View more