Anthony Steven
Anthony Steven

Reputation: 138

SAS Proc Report Subgroup

Let say that I Have a simple table that have four variables (Company, Profit_January, Profit_February, Profit_March).

I would like to display my report to be like this:

enter image description here

In which, the Profit_January, Profit_February, and Profit_March is under subgroup Profit. Is it achievable doing Proc Report?

Upvotes: 0

Views: 345

Answers (1)

Dominic Comtois
Dominic Comtois

Reputation: 10401

Yes it is achievable. On the COLUMN statement, doing like so will give you the expected results:

PROC REPORT  DATA=mydata  NOWINDOWS;
  COLUMN Company ("Profit" Profit_January Profit_February Profit_March);
  DEFINE Company / <...> ;
  DEFINE Profit_January / DISPLAY "January" ;
  DEFINE Profit_February / DISPLAY "February" ;
  <etc.>
RUN;

Upvotes: 2

Related Questions