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 Problem

Featured Replies

I have a simple FM6 database that includes a text field "Activity" and a calculation field "Group".

I have set up a calculation based on the data in "Activity" to give a result in "Group"

eg

If(Activity="SRC","School Representation",

If(Activity="Sports Council","School Representation",

""

)) etc.

But I have a range of data in "Activity" such as

Merit - Science

Merit - English

heaps of etc.

What I want to do is to identify the text "Merit" within each record to end up with a calculation that produces the data "Academic Award" in the "Group" field because I don;t want to write a heap of If(Activity=) for each possibility.

Is there an operator I can use here?

TIA

Stephen K

Hi Stephen, you might try:

Case (

Activity = "SRC" or

Activity = "Sports Council" , "School Representation" ,

Position ( Activity , "Merit" , 1 , 1 ) , "Academic Award"

)

PatternCount() would also work but Position() is faster. And you can use OR between each Activity entry, which will shorten it a bit (so you don't have to write "School Representation" each time ...

LaRetta :wink2:

I have a simple FM6 database that includes a text field "Activity" and a calculation field "Group".

I have set up a calculation based on the data in "Activity" to give a result in "Group"

eg

If(Activity="SRC","School Representation",

If(Activity="Sports Council","School Representation",

""

)) etc.

But I have a range of data in "Activity" such as

Merit - Science

Merit - English

heaps of etc.

What I want to do is to identify the text "Merit" within each record to end up with a calculation that produces the data "Academic Award" in the "Group" field because I don;t want to write a heap of If(Activity=) for each possibility.

Is there an operator I can use here?

TIA

Stephen K

You could use a related value instead, where the relationship is based on the short name/initials you have mentioned and an associated field in the related table shows the full name. Of course this is easier in FileMake 7/8 because it is so much easier to add special purpose tables instead of entire new files.

  • Author

Thanks LaRetta

I'll try it...

Stephen K

  • Author

Thanks BruceR

I won't go that far...its making the solution more complex...for me...

I guess what I want is a Calculation that finds a particular word without doing a Find.

Stephen K

If Merit is always the first word in Activity in those to which you want to assign "Academic Award" then you could try If(Left(Activity,5) = "Merit","Acadmic Award"

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.