Jump to content
Server Maintenance This Week. ×

Find and display the Number of Males and Females in a field????


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

Recommended Posts

  Ok, I hope this is simple.... I have a headache over this and can't figure it out!

I have imported data from an excel spread sheet.  ONe of the columns is if the person is a male or female.  I simply want to put in the header a count of the number of females and males.   

 I have tried many different things for the past 3 hours.  

The field name is "Gender".

I tried this with value count, and just "count", and can't see to pull out the word "Male" out of the 40,000 fields. 

ValueCount ( FilterValues ( List ( Database::Gender ); "Male" ) )
PatternCount ( "Male" ; Database::Gender )

 

I tried setting it up in the field as a Calculation, number and text.  I have no luck. Please help my rookie ignorant self get this simple field!

Link to comment
Share on other sites

1 hour ago, 1FilemakerMan said:

ValueCount ( FilterValues ( List ( Database::Gender ); "Male" ) )

The List() function can summarize records in a related table - not records in the found set. For this, you need to define a summary field as List of Gender. Then your formula will work - though with 40k records it may not be instant. Perhaps it would be better to script this and only refresh it on demand.

Of course, this is assuming you want to summarize the found set (you didn't say so explicitly).

 

Edited by comment
Link to comment
Share on other sites

I am not worried about how long it takes.  Can you help some more on how to develop a "summary field"? I created a new field and and I am trying to count the number of times "Female" appears in it.  This is driving me nuts!!!!!

Link to comment
Share on other sites

ValueCount ( FilterValues (List (RN_Answers_z::Gender); "Male" ) )
                                                          ^Name of Table, ^ Name of field in the table

 

I thought this would work, but it only shows "1".

I made my FieldTable for the answer global, not sure if that is needed or not.  What am I missing?????

Also, in the Fields area, what type of Field should this be?  Number, Summary, or something else?

Link to comment
Share on other sites

1 hour ago, 1FilemakerMan said:

Can you help some more on how to develop a "summary field"?

Like this?

image.png.ce0c5c40177437d21ac2e20a57411a66.png

Once you have that, a calculation of:

ValueCount ( FilterValues ( Database::sListGender ; "Male" ) )

will return the count of males in the current found set. In the old days, you could subtract this from Get ( FoundCount ) to get the count of females; nowadays I am not so sure ...

 

Link to comment
Share on other sites

  • 3 weeks later...

OK, I found a way to display/count the number of males and females without any duplicate records!  Now how can I take that number and store it as a $$Global_field, so that I can display the results in a report. 

Ok, to get the number I simply created a Script that does the "Perform Find" function.
Inside the perform find function I can filter out what I need to, to get the amount of males and females.  Question is, can I take that total and put it into a Global field and display it?

Right now I have a button to push in the report to activate the script and it then displays it, but I would like to display both totals, for male and females, on the same page at once.

Thanks again gentlemen 🙂

Screen Shot 2019-11-04 at 3.49.44 PM.png

Screen Shot 2019-11-04 at 3.50.46 PM.png

Screen Shot 2019-11-04 at 3.56.10 PM.png

Link to comment
Share on other sites

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