Hi! Can anyone help me with how to add percentage columns in my proc report? I want the sum columns first for my across variable, then followed by percentage columns for my across variable.
This is my code so far and the output it produces:
proc report data=sashelp.shoes
(where=(region in ('Africa', 'Asia','Canada'))) nowd;
column Product Region, sales;
define product/group;
define region/across;
define sales/'sales in USD';
rbreak after/summarize;
run;
Region
Africa
Asia
Canada
Product
sales in USD
sales in USD
sales in USD
Boot
119835
62708
385613
Men's Casual
562794
11754
441903
Men's Dress
318500
119366
920101
Sandal
190409
8208
14798
Slipper
337076
152032
952751
Sport Shoe
22150
2092
140389
Women's Casual
417516
25837
410807
Women's Dress
374308
78234
989350
2342588
460231
4255712
But I want my report to give me a table like this:
Region
Region
Africa
Asia
Canada
Africa
Asia
Canada
Product
sales in USD
sales in USD
sales in USD
pct
pct
pct
Boot
119835
62708
385613
5 %
14 %
9 %
Men's Casual
562794
11754
441903
24 %
3 %
10 %
Men's Dress
318500
119366
920101
14 %
26 %
22 %
Sandal
190409
8208
14798
8 %
2 %
0 %
Slipper
337076
152032
952751
14 %
33 %
22 %
Sport Shoe
22150
2092
140389
1 %
0 %
3 %
Women's Casual
417516
25837
410807
18 %
6 %
10 %
Women's Dress
374308
78234
989350
16 %
17 %
23 %
2342588
460231
4255712
100 %
100 %
100 %
How can I do this in proc report? I'm using sas eg 7.13.
... View more