Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a table with fields that have a yes or no entry. Can I create a new field and write a script that will count all the yes entries and all the no entries separately.

Posted

Wouldn't bet on this with v7 (I don't have it here for the test), but you may just try a Sum(Cartesian::MyField)

Yes and No would equal 1 or 0.

So Sum(Cartesian::MyField) gives all yes while Get(RecordCount)-Sum(Cartesian::MyField) gives all no.

Posted

If you want the grand total of yes's, then you would need a summary field for each yes/no field and then a calculated field using GetSummary multiple times to add all those summary fields. You would then get the no's by subtraction. Whew...

Or you could write a script to loop over all records, and loop over all fields within a record, adding to two global fields, sum_yes or sum_no, depending on the content of the field.

Posted

I didn't catched there was multiple fields in each record.

If so, and if v7 still allows for text boolean values, then a calc B)

YesTotalPerRecord = TextYN_1+TextYN_2+TextYN_3+...TextYN_n

NoTotalPerRecord = Number of TextYN fields -(YesTotalPerRecord)

Then you may use Summary Fields or Sum (Relationship) according to your needs.

Does this stil work with 7 ?

Posted

Got side-tracked sorry. Here's the rest of it ...

Create YES number standard field with:

(Field1 = "Yes") + (Field2 = "Yes") + (Field3 = "Yes")

Use auto-enter via this calculation, unclick 'Do Not Replace.'

Repeat with "No:". Then create a Summary calc (or summarize in report). I wouldn't script it at all because you'll have to run script every time a value might change.

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