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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.