BookmarkSubscribeRSS Feed
alexgouv
Obsidian | Level 7

Hi, 

 

I am trying to find the number of accounts that are responsible for the top 25%, 50%, and 75% of sales in each region. The final output needs to be something like 4 accounts make up the top 25%, 9 make up the top 50%, etc.

 

If there is a way to flag which group each account is in that would be ideal but any guidance would be helpful at this point. 

1 REPLY 1
Reeza
Super User
Depends on the data structure overall, but using PROC RANK should work.

proc rank data=have out=want groups=4;
by region;
var sales;
rank rankSales;
run;

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
  • 412 views
  • 1 like
  • 2 in conversation