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 6405 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've not had any luck trying to figure this one out - my calculation skills are minimal!

I have a Calculation (thanks Ted S /Genx) for a field called 'KN Prefix' which works just fine:

Let (

[

dotCount = PatternCount ( VFX::KN Input Temp; "-" );

dotPos = Position ( VFX::KN Input Temp; "-"; 1 ; dotCount )

];

Left ( VFX::KN Input Temp; dotPos - 1 )

)

However if a field called 'Slate' in the same table is empty, I want this calculation to either stop or if a value has already been entered in 'KN Prefix' I need it to be cleared.

In simple (non FM) terms its needs to do this before the calc:

if Slate is empty

then clear KN Prefix

and stop

otherwise continue

Apologies for the crude description,

Thanks, Mark

Posted

One field cannot clear another field, unless the process is automated with scripts and/or event plugins, which are generally not necessary.

You explanation isn't really clear.

I'd have a field called "KN Prefix Entry" which is a text field, and a field called "Slate" whch is also a text field.

Create a calc field called "K Prefix" which would be:

If( IsEmpty( Slate ) ; "" ; KN Prefix Entry )

If Slate is empty then display nothing, otherwise display the contents of KN Prefix Entry.

Posted

Thanks Vaughan. That seems to work well. One last question though:

Is it possible to have a Lookup request as part of that if statement? So instead of saying use 'KN Prefix Entry' if 'Slate' is not empty, it would be something like, do Lookup if 'Slate' is not empty?

Thanks, Mark

Posted

Why do you want to use a Lookup?

Lookups are *only* useful if there is a need to bring in a related value at the time of record creation and keep it static for historical purposes (like a price, or a tax rate).

If you want to bring in a *related* value, then just specify it in the calculation.

A looked-up value would be done by adding another text/number field as a lookup, then including this in the calc. The field would have the value in it even if it isn't needed.

Posted

Good point! I am still finding my feet in this area and hadn't fully understood when to use Lookup and when to use Calculation. You're absolutely right though, a calc is much more suitable. This is all working great now, thanks for your time and help.

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