I have a dataset with variables as "SalesID", "ActualSales" , "TargetSalesAmt" and "Region". I need to create a performance index based on total sales achieved against the target set, and identify the best performing region overall. How can this be done without using Proq SQL.
Example:-
SalsID | ActualSales | TargetSales | Region |
---|---|---|---|
XE908 | 19000 | 13800 | East |
XA908 | 20000 | 18000 | East |
XC102 | 25000 | 30000 | West |
XB102 | 15000 | 18000 | East |
XA908 | 20000 | 22000 | West |
XE908 | 10000 | 10000 | North |
XB102 | 30000 | 25000 | South |
Can you define in more detail what a performance index is? Perhaps by give some sample desired output?
And why not SQL?
Hi Linush.. Actually I want to represent the above data in a format which is some what like:-
1. Region with Highest Sale
2. Sales achieved (BY salesID) and also if they have been able to meet their targets
Y no SQL:- am looking for a very basic resolution for this problem. I want to test out if this is possible thru any basic SAS proc/data statements.(they might be a bit tedious)
Depending upon your definition of performance index, something like the following might suffice:
data have;
infile cards dlm='09'x;
input SalsID $ ActualSales TargetSales Region $;
cards;
XE908 19000 13800 East
XA908 20000 18000 East
XC102 25000 30000 West
XB102 15000 18000 East
XA908 20000 22000 West
XE908 10000 10000 North
XB102 30000 25000 South
;
proc summary data=have nway;
var ActualSales TargetSales;
class region;
output out=want (drop=_:) sum=;
run;
data want;
set want;
growth=ActualSales/TargetSales-1;
run;
proc sort data=want;
by descending growth;
run;
Merge against the output from
PROC MEANS data= dataset missing noprint nway ;
Class region ;
Var _numeric_ ;
Output out= index_perf( drop= _type_ )
Sum= /autoname ;
Run;
Like
proc sort data= dataset ;
By region ;
Run ;
Data index_and_data ;
Merge dataset index_perf ;
By region ;
****** suitable performance calcs ;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.