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.

Field Calculation based on contents of 3 other fields

Featured Replies

What I need is for a calculated field to display a "DueDate" based on the contents of three other fields. So, if both other criteria are empty then display Field A, if Field B has data display it, and if Field C has data but not Field B, then clear the Field A data, and leave the field blank.

Too convoluted?

So what I need is an IF, AND, THEN(else?) function, but am not savvy enough yet to put it together.

I need it to evaluate the following for my "[color:red]DueDate" field:

The fields involved are: [color:red]Deadline, [color:red]FinalDeadline, and [color:red]FinalDateIn.

What I need is the "[color:red]DueDate" Field to display "[color:red]Deadline" when there is no data in "[color:red]FinalDeadline" but only when there is no data in the "[color:red]FinalDateIn" field. If there is data in "[color:red]FinalDateIn" then leave the "[color:red]DueDate" field blank.

[color:blue]My attempt at figuring out how to code it:

If ( IsEmpty ( REPORTS Table::FinalDeadline ) and If ( IsEmpty ( REPORTS Table::FinalDateIn )

GetField ( REPORTS Table::Deadline )

else If ( IsNotEmpty ( REPORTS Table::FinalDeadline )

GetField ( REPORTS Table::FinalDeadline )

else If ( IsNotEmpty ( REPORTS Table::FinalDateIn )

DueDate = 0 (0 = whatever command leaves the field blank)

Thanks for your help!

EDIT:

If ( IsEmpty ( REPORTS Table::FinalDeadline ) and If ( IsEmpty ( REPORTS Table::FinalDateIn ) = GetField ( REPORTS Table::Deadline )

or If ( IsValid ( REPORTS Table::FinalDeadline ) = GetField ( REPORTS Table::FinalDeadline )

or If ( IsValid ( REPORTS Table::FinalDateIn )....dunno

Edited by Guest

Read this:

http://edoshin.skeletonkey.com/2006/06/linked_fields.html#more

--sd

  • Author

Thanks for the reference Søren, I was just given the solution on another forum and my next task was to go and learn how to do it myself.

Cheers!

FYI

Solution (Thanks to [color:blue]doughemi on FileMaker Cafe):(

Case(

IsEmpty ( REPORTS Table::FinalDeadline ) and IsEmpty ( REPORTS Table::FinalDateIn ); Deadline;

not IsEmpty ( REPORTS Table::FinalDeadline ); Table::REPORTS Table::FinalDeadline;

not IsEmpty ( REPORTS Table::FinalDateIn ); ""

)

This can be simplified:

IsEmpty ( REPORTS Table::FinalDeadline ) and IsEmpty ( REPORTS Table::FinalDateIn )




...into:




not Count(REPORTS Table::FinalDeadline;REPORTS Table::FinalDateIn)

--sd

  • Author

Very cool Søren, thank you!

LOL, wouldn't:


IsEmpty ( REPORTS Table::FinalDeadline & REPORTS Table::FinalDateIn ) 

 be simpler?





Speaking of simplifications, I believe the following should produce the same results:





Case ( 

not IsEmpty ( REPORTS Table::FinalDeadline ) ; REPORTS Table::FinalDeadline ;

IsEmpty ( REPORTS Table::FinalDateIn ) ; Deadline 

)

 

Or, if the fields are (as it seems) date fields:





Case (

REPORTS Table::FinalDeadline ; REPORTS Table::FinalDeadline 

not REPORTS Table::FinalDateIn ; Deadline

)

Indeed!!!

--sd

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.