BookmarkSubscribeRSS Feed
Gangi
Obsidian | Level 7

There are n number  of customers belongs to one branches and there multiple managers(say 3 managers in this case) in the same branch.

some customers are reserved to manager1, need to assign rest of the customers managers such that all the managers are assigned to equal number of customers.

 

Customer_NBR   Branch   Assign_ID

1                          abc         Manger1

2                          abc         Manager2

3                         abc          Manager2

4                         abc           --

5                         abc           --

.

.

.

100                    abc          --

 

After assigning mangers  to each customer, I would need each manager to have equal number of customers assigined

 

Manger1   34 Customers

Manager 2 33 Customers

Manager3   33 Customers

 

 

 

5 REPLIES 5
andreas_lds
Jade | Level 19

Please post the data you have in usable form: a data step using datalines.

 

Without "some customers are reserved to managerX", proc rank could do the job, but i think some additional steps are required to fulfil the requirement.

Gangi
Obsidian | Level 7

attached the data,

 

In sheet1 Customer_id is assigned to ID1, if that ID matches to manager in Sheet2 for that branch then Cu will get same manager. if not assign to other manager in the same branch. But Finally each manager should get equal number of Customers  assigned to them.

 

In this case, 

for abc branch,  below number customers assigned to each manager.

manager1-- 32

manager2-- 32

manager3-- 31

 

Thank you 

 

 

Patrick
Opal | Level 21

So you have 3 tables to start with? Something like: customer_branch, branch_manager, manager_customer?

Or do you already have a single table to start with? If so where would we get the full list of all managers belonging to a branch (even the ones without pre-assigned customers)?

Posting sample data in form of a data step(s) is what helps us to spend the time answering your question instead of spending the time preparing sample data.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 911 views
  • 1 like
  • 4 in conversation