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



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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