Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to extract specific amount from row with multiple number sets

PDempsey
7 - Meteor

Hello,

 

I need to extract the amount 32,765.00 from the string below.

Sometimes it will be preceded by EUR, other times USD etc.

I tried using Regex but it only extracted the "121212121" at the end of the text.

Appreciate any help, thanks in advance.

 

Convert Please Pay EUR 32,765.00  Inv No: DCB121212121
10 REPLIES 10
binuacs
21 - Polaris

@PDempsey One way of doing this

binuacs_0-1687192077932.png

 

tristank
11 - Bolide

Hello,

 

This wasn't the simplest approach because my regex isn't great but if you're like me in that sense it's good to play around and look for easy alternatives. The workflow is attached below.

 

Have a good day!

Tristan

 

tristank_0-1687192207326.png

 

tristank
11 - Bolide

This also worked if the strings before the currency stay the same: "Convert Please Pay \u\u\u (.*) Inv"

 

And the plus side it just requires one tool (still need to clean up white spaces tho)

PDempsey
7 - Meteor

Thanks all, however, it now seems I have to allow for other words appearing after the amount. Given the words before the 3 digit  currency code and the amount will always be the same "Convert Please pay" (e.g. Convert Please pay USD 32,750) followed by the 3 character Currency code and the amount, can anyone suggest how to allow for different Currency codes appearing and just extract the amount on each row each time? Much appreciated.

binuacs
21 - Polaris

@PDempsey If the "Convert Please pay" is constant you can try the below regex

 

binuacs_0-1687196140484.png

 

danilang
19 - Altair
19 - Altair

Hi @PDempsey 

 

In future, please try to include a sample input file that includes all variations of your data.  This will allow us to build a generic solution without any unnecessary back and forth.

 

Thanks

 

Dan

PDempsey
7 - Meteor

Thanks, still struggling to break out the amount on every row. See attached file for a few variations. Appreciate if someone can help me to always pick up the amount after the 3 character currency code.

nagakavyasri
12 - Quasar

Try this

Screenshot 2023-06-20 134412.png

binuacs
21 - Polaris

@PDempsey Updated workflow attached

binuacs_0-1687283669511.png

 

Labels
Top Solution Authors