Extracting based off of a portion of the field
Forums
I did some searching on here and could not find what I'm looking for. I have a bank account which has two different debit cards associated with it. On the bank statement, the description of the purchase will look similar to "Walmart Toledo, OH 1234" with 1234 being the last four of the debit card. This desctiption column was imported as "Character". I'm trying to extract all transactions which contain 1234 in the description column. How do I accomplish this? Thanks
Hi jstromain,
Hi jstromain,
As Brian said above there are many ways to do this. My suggestion would be:
@justnumberstrailing(description) = 1234
If you need to extract more than one debit card's purchases into a file then you could use:
@match(@justnumberstrailing(description), 1234,5678,1135) and so on for as many last 4's you needed to extract.
If you want to search for
If you want to search for more than one term using an equation I would recommend the @REGEXPR function. Unlike @isini, this function is case sensitive so you have to nest in an @upper or @lower when using it. See example below:
@regexpr(@lower(description), "walmart|target|sears")
This allows you to isolate all three stores with one equation. The vertical lines in the equation are a pipe (|) symbol found above the backslash key so shift+\. It's important that the letters you type between the quotes match the case of the function used with your character field. Notice I used @lower and all my letters are lower case between the quotes.
Hi jstromain,
Hi jstromain,
There are many ways you could create an extraction equation. Here is one example for you:
@Strip(@right(MY_FIELD, 4)) == "1234"
In this case I use the @strip to remove any extra spaces that there might be and then I use the @right to get the last 4 right characters and compare them to 1234. So this equation will extract all records that end in 1234 for that field.
Hope that helps.
Brian