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.

Perform Find on a Calculated Field

Featured Replies

I feel like I am about to ask the most rookie question ever... but here goes anyway...

I'm performing a find on a calculated field that is supposed to be a non-zero number (it is actually a count). I basically want to find all records where "Needs Review" is true (non zero).

Here's the calculated field definition:

a5f2c6e545c1430bbb9260c341e29d70.png

When I perform find on "Needs Review" ">0", I always get no records found, even though there are some there. 

What am I doing wrong?

365ac19d466c4e038507cefea6fec8fc.png

Thanks,

Ryan

  • Author

Thanks for the reply, Steve, but that returns records that are 0 as well. I only want records that are greater than 0.

What is the result type of the calculation field? And while we're at it, why does it require the "0 +" part?

  • Author

The result type is Number. I had a problem with a calculated field returning nulls for a report one time, so I threw the "0+" in my calculated fields since then and have kind of kept the habit. Especially for fields I plan on using as a booleans.

Well, I can't reproduce your problem based on your description.

 

19 minutes ago, RyanESmith7 said:

I had a problem with a calculated field returning nulls for a report one time

Perhaps that has something to do with it.

What do you see when you enter find mode; click in the field; choose the command "Insert from Index" ?

19 minutes ago, BruceR said:

What do you see when you enter find mode; click in the field; choose the command "Insert from Index" ?

The field is unstored; is there any doubt that "Insert from Index" will be grayed out?

Somehow I missed the calc definition. Yes; it won't have an index.

Is the calculation result type set to 'Number'? If you have it set to 'Text' that can give very unexpected results.

Also, uncheck the 'Do not evaluate if all referenced fields are empty' to see if that helps.

Otherwise, I would try a 'Recover' on the file.

I have seen this sort of problem on files we run where we have fields that are a result of the Sum of lots of related fields. I sometimes wonder if there is an obscure bug in FileMaker around this, but then I remember that most 'bugs' turn out to be 'user misunderstandings'!!

  • Author

This is starting to look like a FMS bug to me. I have similar code in another database on the same server, and it too is not finding records where a calculated result (number) is > 0.

That exact same code is running on one of my databases that's on an older FMS server (version 13) and it is working fine there.

I thought I was going crazy... this should be working and I'm pretty sure that it WAS working for a long time, but now I'm seeing it on multiple database in different scenarios, but all one one server that is hosted.

Server Version

14.0.4.412

 

Edited by RyanESmith7

15 minutes ago, RyanESmith7 said:

This is starting to look like a FMS bug to me.

You did not mention this was a served file. I recall similar issues being reported before, regarding search in unstored calculation fields of served files. If I remember correctly, the solutions involved:

  • updating the server software to the latest subversion;
  • restarting the server.

 

 

 

Edited by comment

  • Author

Thanks, comment. When I started investigating this, I thought I was doing something wrong 'cause I saw it in some new code. But now that I see it affecting old code, too, I'm putting 2 and 2 together. I'll reach out to my vendor and see if they can update and restart the server.

  • Author

Confirmed. Downloaded one of the DBs to my local PC and the code works there. Doesn't work on hosted.

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.