Untitled
unknown
plain_text
10 days ago
880 B
1
Indexable
Never
/* Assuming 'TopRegion' is the top region you want to focus on */ proc means data=your_dataset noprint; class Country Gender; where Country='TopRegion'; var Sales; output out=summary_stats sum=TotalSales; run; data contribution; set summary_stats; Percent_Contribution = Sales / TotalSales * 100; run; proc print data=contribution; run; /* Assuming 'your_dataset' is the name of your dataset */ /* Assuming 'TopRegion' is the top region you want to focus on */ proc sql; create table top_region_summary as select Country, Gender, sum(Sales) as TotalSales from your_dataset where Country = 'TopRegion' group by Country, Gender; quit; /* Calculate percentage contribution */ data contribution; set top_region_summary; Percent_Contribution = TotalSales / sum(TotalSales) * 100; run; proc print data=contribution; run;
Leave a Comment