Jump 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.

Featured Replies

I have table 1 field 1 formated as text and the source of the value is imported via script from a .csv file and "n" quantity of records where "n" > 0.

The only two possible formats for values in field 1 are...

xxx, xxx xxx, vvv

or

xxx, xxx xxx (xxx), vvv

where x equals any alphabetic text value, vvv equals any positive integer, and the spaces are exactly as written.

I have to reduce field 1 values from their current format to:

A. In the first case, remove everything after and including the second ","

B. In the second case remove everything after and including the first "(".

I know i can....

go to correct layout

go to first record

start loop

set variable($1;Value:Position(field 1; ",", 2))

set variable($2;Value:Position(field 1; "(", 1))

but then how do I use these variables to replace the values in field 1 with the edited values for "n" quantity of records?

(i.e. if field 1 record 1 contains "jerry, thomas b, 1234" how do I truncate field 1 record 1 to "jerry, thomas b")

TIA,

Kris M

I don't think you need the variables. Simply set the field to:

Let (

pos = Position ( field ; "(" ; 1 ; 1 )

;

Case ( pos ;

Left ( field ; pos - 1 ) ;

Left ( field ; Position ( field ; "," ; 1 ; 2 ) - 1 )

)

)

Note that I have taken the remove everything after and including the first "(" requirement literally, but it seems like it leaves an extra space - so perhaps

Left ( field ; pos - 2 ) ;

might be more appropriate.

  • Author

That -2 would be correct and allows me to drop a call to the trim function. Thanks.

  • Author

Ok now i have a detail question regarding the case function...

You have the test written as pos with no evaluation...Pos can have two values either zero, if the "(" is not found, or an integer for the position of the first "(" starting from the first position.

How does this evaluate to true or false as is stated in the functions ref? I am wondering how case knows which result to return.

TIA

Kris

In Filemaker, any numerical value other than 0 evaluates to TRUE.

  • Author

Ok that explains it. Thanks

Create an account or sign in to comment

Important Information

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

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.