Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I want to make this field (PO# Field) a calculation field to show results based on fields: Facility field and Equipment field. For example if Facility = "Mercy Hospital" and Equipment = "mattress", result should be: PO2222, but if Facility= "St John Hospital" and Equipment= "mattress", result should be PO4444.
Question is: what would be the syntax for the calculation on the PO# field?

 

Please see Picture attached

 

Using FMP 13 on PC

post-103927-0-98884000-1397074207_thumb.

Posted

The two examples you have given do not explain the logic by which such calculation should proceed. I suspect you really want to do a lookup here, but that's just a guess. You should explain in more detail.

  • Like 1
Posted

Question is: what would be the syntax for the calculation on the PO# field?

 

Well, you almost spelled it out already:

Case (  Equipment = "Mattress" ;
  Case ( 
    Facility = "Mercy Hospital" ; "PO2222";
    Facility = "St John Hospital" ; "PO4444"
) )
Let me add that while this is the correct syntax for this exact requirement, you probably will want to use an Inventory table in which each record describes a piece of equipment for a facility and has a PO#; then you would be able to look up that PO via a relationship based on those two fields (preferably using equipment and facility IDs instead of names).
 
EDIT: What happened to the "New Post" alert that used to pop up while writing a reply?
Posted

These are not two examples, they are the same example expressed twice.

However what I'm trying to do should be very simple for anyone with experience in FMP. Lets say we have 3 fields in a data base: number1 Facility field, number2 Equipment field and number3 PO# field.

The goal is to make PO# field a calculation field that will automatically populate results based on the following calculations:

If field number1 (Facility field) reads "North facility" and field number2 (Equipment field) reads "chair", then field number3 should read let's say "PO1111"

But If field number1 (Facility field) reads "South facility" and field number2 (Equipment field) reads "chair", then field number3 should read let's say "PO2222" <--- (These are just examples)

Question: what syntax in the calculation field will achieve this?

Posted

However what I'm trying to do should be very simple for anyone with experience in FMP

 

Which according to your Skill Level you should have … :smile: … but then again, it is likely not the right way to go about this.

 

Question: what syntax in the calculation field will achieve this?

 

Why don't you read the replies, e.g. in post #3?

 

Anyway, this is not a question of using the correct syntax, it's a question of the correct data structure.

 

Instead of coding any number equipment/facility combinations to produce a result, you should have a table in place where each facility/equipment combination and its associated PO is encoded as data. Then a simple lookup via a relationship will give you the desired result just by referencing the related PO field, allowing you to add any number of combinations without having to modify the lookup mechanism / calculation field.

Posted

Thanks a lot eos, and yes, the comments you just added are exactly what I'm planning to do. Good stuff appreciate it!

This topic is 3938 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.