PDA

View Full Version : Help in creating combinations/criteria's and normalizing data



Blasphemer
12-09-2008, 07:00 AM
Here's another problem for which I would need help with. Let me start by giving some background info.

I have a table which stores unique account numbers, each account number has following key data points.

1. Application number (Value can be 1, 2 or 3)
2. Account holder's name (Value can be anything)
3. Bank_ID (A numeric value given to banks, I have about 50 bank id's, they all unique)
4. Specialist Name (The person from bank who handles this account, we have about 26 of them right now)
5. Queue_Number (Again a numeric number, these represent queues, there are right now 5 queues)


The bank has limited Specialists, and each one handles some of the accounts. Every Account has a Specialist.

Now, the data that client gets contains "Account number, Queue Number, Application Number, Bank ID". It does not have a Specialist. They then distribute these accounts to their specialists based on 4 criteria's.

e.g. If the

Bank_ID = 1, Queue_Number = 9999, First letter of Name is between A-L, and Application Number = 1... Then the account goes to XYZ
or
Bank_ID = 1, Queue_Number = 9999, First letter of Name is between M-Z, and Application Number = 1... Then the account goes to ABC

Now my problem is if i make all possible unique combinations with all 4 criteria's they come up to be around 4000-5000 combinations. I did this and added them into a table where I use an access query to do a lookup and it takes a fraction of a second to update 1000's of records.

This won't be a problem if it was a one time job, however the problem is the client says that the specialists keep on changing and they will often get new people in. So what that means is coming up with the complete mapping(combinations) everytime there is a new specialists, a new bank, or even a queue. They may also want to reassign combinations.

Problem : How can we automate the process of creating these combinations?

If any of you guys can suggest how to go about doing this I would really appreciate that. Would it be possible to normalize these combinations into smaller tables?

Thanks!

OBP
12-09-2008, 08:01 AM
You said "if i make all possible unique combinations with all 4 criteria's they come up to be around 4000-5000 combinations. I did this and added them into a table".
If you can explain how you did that originally someone here should be able to write the VBA Code to do the same, which they can just run as needed. (After clearing out the table first of course).

Blasphemer
12-09-2008, 08:15 AM
I made the code which creates the combination. However the issue is its very crude. I'm possibly thinking of either normalizing the data, or maybe using if's and loops in SQL if that is possible.

Can we loop in SQL?

OBP
12-09-2008, 08:26 AM
You can loop in VBA which Creates the SQL if that would do?