Hi All,
Can you please assist.
I looking for a way to generate a report as per attached spreadsheet. I want to add total employee + total third party.
Please find a sample.xlsx file.
Regards,
Thokozani
Hi,
If you would like accurate answers, post test data in the form of a datastep so we have something to work with. Personally I tend to code these use SQL:
proc sql;
create table WANT as
select COUNTRY,
sum(PERM),
sum(CONTRACT),
sum(TEMP),
count(EMPLOYEES),
count(AGENCY),
count(CONSULTANTS),
count(AGENCY)+count(CONSULTANTS)
from HAVE
group by COUNTRY
union all
select "Region Total",
sum(PERM),
sum(CONTRACT),
sum(TEMP),
count(EMPLOYEES),
count(AGENCY),
count(CONSULTANTS),
count(AGENCY)+count(CONSULTANTS)
from HAVE;
quit;
If I understand correctly you can't calculate new variables in proc tabulate. You can use proc report for calculations or a data step.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.