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.

Please Tell me there is a better way! (Counting)

Featured Replies

Ok, I've got a staff database with many classifications for position, and I want a tally for how many of each position have been hired. So I defined a Global variable for each possibility wrote a script to count each and store it in the respective globals... the script does a search, moves to the last record, then sets the value of the global to the current record count, which gives me a number I can then display on the layout.

However when there are no hires for a certain position, the whole thing blows up. It gives me a "search returned no results" dialog and bails.

What I'd like is to get a 0 value on positions that have no hires, and continue counting

this would be so much easier (or at least I'd understand it) with SQL... how should I approach this sort of problem in Filemaker?

Add Set Error Capture [On] to the beginning of your script. After the find is performed, add

If [not Status(CurrentFoundCount)]

Set Field [global, 0]

Else

{the remainder of your steps}

End If

It would be faster to do this using a relationship. Create a relationship between a global text field and the classification field. Then create a looping script to set the global with each classification and the Count(relationship::serial) to the respective global number field.

I would add a Position file, related to Staff by PositionID, then use a calc with Count(Staff::StaffID) to show the number in each position.

This design can also help by giving you a place for default values for each position, or HR can keep job descriptions in there.

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.