| |||||||||||||||||||||||||||||||
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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.