| |||||||||||||||||||||||||||||||
The above report gets total and %'s in total column .
(i want 26% in totals)
plz help me
You can use Proc REPORT to get the output you need. You can make use of the computed column functionality:
<
/body>
Hi,
proc sql;
create table WANT as
select *
from HAVE
union all
select "Total" as YEAR,
count(X) as X,
count(Y) as Y,
round((CALCULATED Y / CALCULATED X) * 100,1.) as PERCENT
from HAVE;
quit;
And a Tabulate solution
proc tabulate data=have;
class year;
var x y;
table year='' all='Total',
x *sum=''*f=best4. y=''*(sum='y'*f=best4. pctsum<x>='%'*f=best4.)
/box='Year' ;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.