jpac Posted November 2, 2004 Posted November 2, 2004 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.
Ugo DI LUCA Posted November 2, 2004 Posted November 2, 2004 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.
transpower Posted November 2, 2004 Posted November 2, 2004 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.
Ugo DI LUCA Posted November 2, 2004 Posted November 2, 2004 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 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 ?
MoonShadow Posted November 2, 2004 Posted November 2, 2004 "If so, and if v7 still allows for text boolean values" Nope. vs. 7 does not identify Y/N, Yes/No, T/F or True/False
MoonShadow Posted November 2, 2004 Posted November 2, 2004 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.
Ugo DI LUCA Posted November 2, 2004 Posted November 2, 2004 Ok, I remembered seeing something about v7 discontinuing boolean text structure, but wasn't really sure of it. Thanks for this confirmation MoonShadow.
Recommended Posts
This topic is 7589 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 accountSign in
Already have an account? Sign in here.
Sign In Now