Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6441 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a text field that may or may not contain dollar amounts embedded in the text. For example, a text field might read:

"Expenses related to our trip included $12.50 for lunch and 6.22 for supplies. At 6PM, we had a dinner that cost 21.85. Our only other expense was $6 for cab fare."

What I want to do is parse the field and extract all amounts into a companion array within that same record. The parse rules would be:

If it starts with a dollar sign, then it's definitely an amount (with or without a decimal point)

If it starts with a number only, then it must have a decimal point

I've searched these forums and read about parsing, but nothing seems close enough to really give me a place to start. My questions at this point are:

How should I construct a parse for multiple occurrences within the same text field?

Is it practical to have a calculated, unstored copy of the text field that colorizes each field that was interpreted as an amount? (to display for user confirmation purposes)

I will greatly appreciate any suggestions so I don't start on a wrong path with this. Thanks.

Posted

Thanks for these responses.

sbg2: The scripted approach has some interesting aspects (like passing the Substitute() as a script parameter -- and the accumulating results table). Thanks.

Raybaudi: thanks for providing such an elegant solution. I've added the calc and repeating fields to the test layout to maks sure I followed the calculations -- and as a basis for designing the colorizing step. The nested substitute/ trimall/ substitute is excellent -- and not something I would have thought to try. And special thanks for including the summation of the values (I guess you could see ahead where I was going with this).

This topic is 6441 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.