BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Swati24
Obsidian | Level 7

I have the following data set like this : 

 

Group_NameHead_NameLastYear_CountBeforeLastYear_Count
R&DIT12
R&DTesting05
R&DProduction40
R&DDevelopment10
SalesBook54
SalesProduct100
SalesKit11
AdminMarketing41
AdminHR52
AdminProject63

 

and I want to get the output like the following attachment using proc report.:

 

1 ACCEPTED SOLUTION

Accepted Solutions
singhsahab
Lapis Lazuli | Level 10

HI,

 

data test;
input Group_Name $ Head_Name $	LastYear_Count	BeforeLastYear_Count;
cards;
R&D IT 1 2
R&D Testing 0 5
;
run;


proc report data=test style(header)=[background=white];
 col ('Groups ' Group_Name Head_Name)
 ('total count' LastYear_Count BeforeLastYear_Count );
run;

 

Thanks,

View solution in original post

1 REPLY 1
singhsahab
Lapis Lazuli | Level 10

HI,

 

data test;
input Group_Name $ Head_Name $	LastYear_Count	BeforeLastYear_Count;
cards;
R&D IT 1 2
R&D Testing 0 5
;
run;


proc report data=test style(header)=[background=white];
 col ('Groups ' Group_Name Head_Name)
 ('total count' LastYear_Count BeforeLastYear_Count );
run;

 

Thanks,

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 779 views
  • 1 like
  • 2 in conversation