Jump to content

Calculation Field Problem


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

Recommended Posts

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

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5762 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
 Share

  • Who Viewed the Topic

    1 member has viewed this topic:
    AndersNystrom 
×
×
  • Create New...

Important Information

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