Hey,
I've been putzing around w/ my data (asked around in Queries Forum), and the suggestion presented was a VB module. I've coded a very basic one and got it working, but because I plan on updating my data and things might get changed, I need a VB module that is also easily updated to be able to keep up to date with my data.
This module we at the end be run on 400,000+ pieces of data, so I've been starting slow and building up, testing it on 50-200 data at an instance.
The gist of what I want is to convert from a Title string to a Standard Title, dependant on job role.
Example:
Title String Output (Standard Title)
Sales, Manager Manager of Sales
Director, IS Director of IS or IT
Mgr of Sales Manager of Sales
VP IT VP of IS or IT
Vice Pres Market VP of Marketing
So basically, I'm "standarizing" everything. VP/Vice Pres/AVP/EVP all becomes VP. Department like Customer Service, Customer Svc, Cust Svc, etc.. will all become like "VP of Customer Service"
So right now I have a bunch of IF-THENs:
If (InStr(sUT, "CUSTOMER SERVICE"
> 0 Or InStr(sUT, "CUSTOMER SVC"
) Then
If (InStr(sUT, "VP"
> 0 Or InStr(sUT, "VICE PRES"
> 0) Then
title_trans = "VP of Customer Service"
End If
If (InStr(sUT, "DIRECTOR"
> 0) Then
title_trans = "Director of Customer Service"
End If
If (InStr(sUT, "MANAGER"
> 0 Or InStr(sUT, "MGR"
> 0 Or InStr(sUT, "GM"
> 0) Then
title_trans = "Manager of Customer Service"
End If
End If
But obviously then, if I find another variation of say "DIRECTOR" (ie "DIR"
, then I have to go to EVERY IF look and update it (and I have nested IF loops within every department).
So I figured I'll use an ARRAY and see if I can get this working.. but here I'm stuck 'cause I don't know the limitation of Access DB (I'm a Java, C, non VB user)
What I want to do is something like this:
Have arrays: VPArray, DirectorArray, ManagerArray
where each array will contain all possible variations of the job title
ie VPArray[1] = "VP"; VPArray[2] = "Vice President", etc..
This is when it gets tricky and I don't know if this is doable. If this was C, I would create another Array Department, with Pointers to LinkedLists for each department.
so like:
department[1] --> customer_service, where customer_service[1] = "CUSTOMER SERVICE", customer_service[2] = "CUST SERV"
department[2] --> IS, where IS[1] = "IS", IS[2]= "IT", etc..
Then I would put everything together with for/if/while loops (pseudocode with several diff languages):
// Picks what title the person is
for (each of the different title arrays)
for (int x = 0; x < length(titleArray); x++)
if (InStr(titleString, titleArray[x])
String stdTitle = titleArray[1];
// Find out what department he is
for (int y = 0; y < length(departmentArray); y++)
for (each element in departmentArray, go to all the nodes in the LL)
if (InStr(titleString, string in node)
String stdDept = departmentArray[y].dept
and then combine stdTitle w/ stdDept
------
Does anyone understand what I'm saying or am I being vague? Hehe.
Anyway, is what I want to do possible? And/or does anyone see an easier way for me to do this?
I've been putzing around w/ my data (asked around in Queries Forum), and the suggestion presented was a VB module. I've coded a very basic one and got it working, but because I plan on updating my data and things might get changed, I need a VB module that is also easily updated to be able to keep up to date with my data.
This module we at the end be run on 400,000+ pieces of data, so I've been starting slow and building up, testing it on 50-200 data at an instance.
The gist of what I want is to convert from a Title string to a Standard Title, dependant on job role.
Example:
Title String Output (Standard Title)
Sales, Manager Manager of Sales
Director, IS Director of IS or IT
Mgr of Sales Manager of Sales
VP IT VP of IS or IT
Vice Pres Market VP of Marketing
So basically, I'm "standarizing" everything. VP/Vice Pres/AVP/EVP all becomes VP. Department like Customer Service, Customer Svc, Cust Svc, etc.. will all become like "VP of Customer Service"
So right now I have a bunch of IF-THENs:
If (InStr(sUT, "CUSTOMER SERVICE"
If (InStr(sUT, "VP"
title_trans = "VP of Customer Service"
End If
If (InStr(sUT, "DIRECTOR"
title_trans = "Director of Customer Service"
End If
If (InStr(sUT, "MANAGER"
title_trans = "Manager of Customer Service"
End If
End If
But obviously then, if I find another variation of say "DIRECTOR" (ie "DIR"
So I figured I'll use an ARRAY and see if I can get this working.. but here I'm stuck 'cause I don't know the limitation of Access DB (I'm a Java, C, non VB user)
What I want to do is something like this:
Have arrays: VPArray, DirectorArray, ManagerArray
where each array will contain all possible variations of the job title
ie VPArray[1] = "VP"; VPArray[2] = "Vice President", etc..
This is when it gets tricky and I don't know if this is doable. If this was C, I would create another Array Department, with Pointers to LinkedLists for each department.
so like:
department[1] --> customer_service, where customer_service[1] = "CUSTOMER SERVICE", customer_service[2] = "CUST SERV"
department[2] --> IS, where IS[1] = "IS", IS[2]= "IT", etc..
Then I would put everything together with for/if/while loops (pseudocode with several diff languages):
// Picks what title the person is
for (each of the different title arrays)
for (int x = 0; x < length(titleArray); x++)
if (InStr(titleString, titleArray[x])
String stdTitle = titleArray[1];
// Find out what department he is
for (int y = 0; y < length(departmentArray); y++)
for (each element in departmentArray, go to all the nodes in the LL)
if (InStr(titleString, string in node)
String stdDept = departmentArray[y].dept
and then combine stdTitle w/ stdDept
------
Does anyone understand what I'm saying or am I being vague? Hehe.
Anyway, is what I want to do possible? And/or does anyone see an easier way for me to do this?