Jump to content

This topic is 7393 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

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