Vlookup list of phrases contained in a text field

Sample data for phrase lookup.xlsx (19.1 KB)
Hi,
I am a new user and am really liking what I see here in EasyMorph.

The use case is a download of account activity from brokerage accounts. Processing has already been completed on all the readily identifiable items. However, there are a number of exceptions that have not been addressed through the routine processing to this point.

I do not want to use hardcoded approaches like “if then” statements. Instead, I want to place the exception phrases in a lookup table, so it is easy for the end user to update when new exceptions come up. The lookup table would then return the desired Description Exception Type in a separate column in the source data.

Once the “Desc Exception Type” field is populated, I can write further rules on how to code each exception type, by referring to the “Desc Exception Type” field.

The sample file contains 3 Worksheets.

10-Source Data - Sample records from extract of account activity.

20-Lookup Table exceptions - This table contains the phases of interest that are “contained” in the “Description” column of tab 10.

30 - Desired Result - Each record that includes one of the exceptions on tab 20 now includes “Desc Exception Type” from column 2 of the lookup table. Note that records not appearing in table 20 show a blank.

Doing this manually in excel involves:
1. Setting filters on the source data

2. Clicking dropdown from description column
3. Choosing "Text Filters", "Contains", and the first phrase.   
4. Copying and pasting the exception type description for those rows meeting the criteria
5. Clearing Filters to show the full data set. 

6. Repeating steps 2-5 for the next exception until all exceptions have been coded. 

How can I do this quickly in Easymorph?

Thank you

John

Hi John,

Thank you for providing a detailed description with an example - that really helped.

You can achieve what you need with two actions applied one after another:

Use the “Match” action to identify values that contain exception keywords from the 1st column of the lookup table.

Then use the “Lookup” action, to replace the exception keywords with standardized descriptions from the second column of the lookup table.

See the below project.

match-lookup.morph (5.5 KB)

Thanks. This worked perfectly.

The technique will be very useful for flagging many one off adjustments in an etl process based on a phrase contained somewhere in a text fields such as a description.

You’re welcome! :slight_smile:

PS. Notice that the “Match” action has a fuzzy matching mode. It can be helpful when exception keywords may have typos in descriptions.

1 Like