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.

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

Featured Replies

  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!

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

  • Author

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!!!!!

  • Author

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?

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 ...

 

  • Author

Thanks a MILLION! That did it! I have never seen the "List of" used before! Awesome!!!!

Now I need to take out the duplicates, and I will be done!

10 minutes ago, 1FilemakerMan said:

I have never seen the "List of" used before!

Welcome to version 13.😎

  • 3 weeks later...
  • Author

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

6 minutes ago, 1FilemakerMan said:

Question is, can I take that total and put it into a Global field and display it?

Sure, you can simply set the global field to Get (FoundCount).

Is this a good method? I don't believe it is. 

  • Author

WHere do I put the Get (FoundCount) at ?  I am searching on the internet and not finding any good examples.

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.