The SAS Output Delivery System and reporting techniques

Proc report share of total in across group

Accepted Solution Solved
Reply
Contributor
Posts: 67
Accepted Solution

Proc report share of total in across group

Hi, 

working with proc report I am trying to get something like  share MSRP sum  across orgin and grouped by make and type in  total MSRP sum grouped by make and type. 

What i already have is

 

proc report data=sashelp.cars;
column make type MSRP origin, (MSRP share) ;
define make / group;
define type / group;
define MSRP / analysis sum;
define origin / across order=data;
define MSRP/ analysis sum;
define share / computed ;
compute after type;
tot = MSRP.sum; 
endcomp;
compute after origin; 
share = MSRP.sum / tot;
endcomp;
run;

It`s not working.

 

 

I would be grateful if anyone could help me solve this problem. 


Accepted Solutions
Solution
‎11-15-2017 01:41 PM
SAS Super FREQ
Posts: 9,252

Re: Proc report share of total in across group

Hi:
When you use a COMPUTE block on an item that is UNDER an ACROSS variable, then you must use absolute column numbers, as described on page 9-11 of this paper: https://www.sas.com/content/dam/SAS/support/en/technical-papers/SAS388-2014.pdf

cynthia

View solution in original post


All Replies
Solution
‎11-15-2017 01:41 PM
SAS Super FREQ
Posts: 9,252

Re: Proc report share of total in across group

Hi:
When you use a COMPUTE block on an item that is UNDER an ACROSS variable, then you must use absolute column numbers, as described on page 9-11 of this paper: https://www.sas.com/content/dam/SAS/support/en/technical-papers/SAS388-2014.pdf

cynthia
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 215 views
  • 0 likes
  • 2 in conversation