English 中文(简体)
Using IsEmpty function in a filemaker Pro (v9) calculation with multiple fields
原标题:
  • 时间:2010-01-14 22:52:52
  •  标签:
  • filemaker

I want to write a simple calculation to return a value based on a heirarchy of fields.

If the first field is empty, I want it to return the second, and if the second is empty, the third. I have tried the following but it only returns the first value.

If (IsEmpty (Field1 = 1) ; Field2;
If (IsEmpty (Field2 = 1); Field3; Field1))

I was able to get the first or third value to appear by using:

If (IsEmpty (Field1) &
If (IsEmpty (Field2); Field3; Field1))

But of course this doesn t show the Field2 at all.

Is there something along the lines of:

If (IsEmpty (Field1) &
If (IsEmpty (Field2); Field3; Field1, Field2))

which I can use? This obviously doesn t work because there are too many parameters in the function.

Any help would be very much appreciated! :-)

最佳回答

You need to nest your calc a bit more :

Case ( 
IsEmpty ( Field1 & Field2 ) ; Field3 ;
IsEmpty ( Field1 ) ; Field2 ;
Field1
)

In your examples, you had IsEmpty (Field1 = 1) which will test Field1=1, which is either True or False, but never empty. And the & is a concatentation operator, if you re wanting logical and then use and instead.

问题回答

You could rewrite this in a more transparent way:

Case(
    not isEmpty(Field1); Field1;
    not isEmpty(Field2); Field2;
    Field3
)

(this would be much easier to maintain/read in the future)





相关问题
FileMaker 9 & PHP API - Total record count?

The only way I can see to get a total record count necessary for setting up some sort of pagination mechanism would be something like: $fileMakerObj = new FileMaker( /* credentials redacted */ ); ...

Communication between applescript and FileMaker

I m currently writing an applescript to be run within FileMaker. I need to tell filemaker what the name of its application is (FileMaker Pro or FileMaker Pro Advanced or whatever) so that I can within ...

Filemaker to SQL Server via SSIS

I m using SSIS and trying to import data from Filelmaker into SQL Server. In the Solution Explorer, I right click on "SSIS Packages" and select SQL Server Import and Export Wizard". During the ...

Filemaker GetAs...How to display Container Field on webpage?

I have an ASP.Net application that needs to display an image that is stored in a Filemaker Container field. My query statement looks like: SELECT GetAs(Image, JPG ) FROM UA_Item_Pictures WHERE "...

热门标签