Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation field that removes certain text from a text field

Featured Replies

Hi guys,

I've FM 5.5v1 running on OS X 10.6.8.

I've a text field titled "Country 1" with many different records, like this:

Italy [ITA] / ITALY - Italian company (active) [iTA33] [Checked]
Spain [ESP] / SPAIN - Spain company [ESP29] [Checked]
France [FRA] / FRANCE - France company [FRA87] [Checked]
etc.

I would like to create a Calculation field that removes everything with the exception of the country name at the start (the red text).

The only common denominator on all records is that there's a space followed by a "[" after each country name (green).

What would the calculation had to be like?

And:

I've another text field titled "Country 2" with many different records, like this:

Italy - Italian company name
Spain - Spain company name
France - France company name
etc.

Here I would also like to create a Calculation field that removes everything with the exception of the country name at the start (the red text).

The only common denominator on all records is that there's a space followed by a "-" after each country name (green).

What would the calculation had to be like?

Best,
 

Try:

 

Left ( text ; Position ( text ; "[" ; 1 ; 1 ) - 1 )

 

... then just replace the bracket with the dash for the next one


ooops ... version 5 ... replace semi-colon with comma, I think, unless you are Australian or international.

You could also use LeftWords(text, 1) for both.

 

EDIT:  Bah, use LaRetta's calc.  Mine will fail for two word countries, such as New Guinea, if they exist in your data.

  • Author

Hi LaRetta!

 

OK, let me try it out and I'll post result in a few minutes...

 

Best!


Hi doughemi!

 

OK, understood!

 

Best!

Was the Let Calculation available in v 5. ?

Umm, Lee...Left, not Let (but you're right, Let didn't appear until FM7).

  • Author

Hi LaRetta! It worked fine!! Thank you! :laugh2:

oops. :blush3:

 

I have got to get my eyes examined!

 

Actually, I was working with the TimeStamp import for DLM and was trying to remember the Functions in v5. I wish I hadn't upgraded to Mountain Lion, it killed my versions of 6.

 

Anyway, when I read this thread, my mind saw it as Let. Thanks for the correction.  

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.