Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Function to match two items

HI All,

I am not sure this can be done but wanted to throw it out and see if anyone can help:

The Problem:  I have two tables with Vendor Information listed and the vendor is spelled slightly different in both tables.  Is there a way to do some match, fix, or anything else to correct the issue.  Here is an example of what I am talking about:

Vendor Table 1

AEP-Energy

Vendor Table 2

AEPEnergy

In other words the Vendor name in both list is the same but spelled slightly different.  Is there any tricks out there.

David

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

THe easiest way is this:

I think you have a vendor code, so startting from it create a xlsx (or a table) with code and correct name.

Load that xlsx and use its name as the only one

stabben23
Partner - Master
Partner - Master

Hi David,

the purgchar('field','-') is one example.

sudeepkm
Specialist III
Specialist III

You can use

1. Upper or lower functions if both the field values have same name but in different case

2. purgechar to remove cuh characters you find as a difference in between two names

3. trim for any spaces around the names

ashwanin
Specialist
Specialist

use Wildmatch function

jerem1234
Specialist II
Specialist II

Another option is to do a Mapping like:

map1:

Mapping Load * Inline [

Column1,Column2

AEP-Energy, AEPEnergy

...

];

Where AEP-Energy is the text it is in and AEPEnergy is the text you want it to be. Then do an apply map when you load field like:

applymap('map1', FIELD) as FIELD

Hope this helps!

nizamsha
Specialist II
Specialist II

         Replace( Fileld,'-','')

or

        if it was like this mean AEP-Energy  Aep-Energy


use this one

       upper(Replace( Field,'-',''))

       Lower(Replace(Field,'-',''))

or

        use Purgechar(field,'-')

sunilkumarqv
Specialist II
Specialist II

//     Rename the Field:

FieldMap:

Mapping SQL SELECT oldnames, newnames FROM datadictionary;

Rename fields using FieldMap;

// Rename the Table

Tab1:

Select * from Trans;

Rename table Tab1 to Xyz;

TabMap:

Mapping load oldnames, newnames from tabnames.csv;

Rename tables using TabMap;

// Rename the Fields

Alias ID as CustomerID;

Load * from Customer.csv;

or

Load ID as CustomerID, Name, Address, Zip, City, State from Customer.csv;