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-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

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