BookmarkSubscribeRSS Feed
Deepakkala04
Fluorite | Level 6

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:-

SalsIDActualSalesTargetSalesRegion
XE9081900013800East
XA9082000018000East
XC1022500030000West
XB1021500018000East
XA9082000022000West
XE9081000010000North
XB1023000025000South
4 REPLIES 4
LinusH
Tourmaline | Level 20

Can you define in more detail what a performance index is? Perhaps by give some sample desired output?

And why not SQL?

Data never sleeps
Deepakkala04
Fluorite | Level 6

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)

art297
Opal | Level 21

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;

Peter_C
Rhodochrosite | Level 12

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;

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
  • 4 replies
  • 2184 views
  • 7 likes
  • 4 in conversation