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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.