BookmarkSubscribeRSS Feed
ashishj816
Quartz | Level 8

Hi All,

 

I want to show Ranking of Customer Based on Revenue.

I know that there is feature of SAS VA where we can select Rank based on which measure.

But I also want to show Rank number.

 

Ex:-

Customer Name Rank Revenue 
C1 1999
C22998
C33987
C44986
C55985
1 REPLY 1
ballardw
Super User

@ashishj816 wrote:

Hi All,

 

I want to show Ranking of Customer Based on Revenue.

I know that there is feature of SAS VA where we can select Rank based on which measure.

But I also want to show Rank number.

 

Ex:-

Customer Name  Rank  Revenue 
C1  1 999
C2 2 998
C3 3 987
C4 4 986
C5 5 985

Do you want to do this in VA or base programming code? You have posted this in an area that is intended for general programming, not VA.

This is a general programming solution using the Sashelp.class data set and ranking based on height.

proc rank data=sashelp.class
   out=work.classranked
   descending
;
   var height;
   ranks heightrank;
run;

proc sort data=work.classranked;
   by  heightrank;
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
  • 942 views
  • 0 likes
  • 2 in conversation