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.

How do I calculate the percentage of a same number in a field to the total record count?

Featured Replies

I would like to find out something important for my project...

 

I have 100 records and

 

44 of those records contain in a field called "division"  the number '4"

33 of those records contain in the devision field  the number "3"

 

So to find out the percentage of those answers it would be respectively

44% and 33%  I would get that by a calculation dividing the number of listing of that number by 100

 

How do I get a count of all the records that contain in the field division the number "4" ?

I am stuck. 

Thanks

You could use ExecuteSQL  ( i haven't tested this so your mileage may vary ) 

 

SELECT AVG(column_name) FROM table_name WHERE column_name = "4" 

 

SELECT AVG(column_name) FROM table_name WHERE column_name = "3"

 

or create a field in FMP and call it "IsThree" and it resolves to one when your division field is "3" / same with four then you can do your aggregated average on these fields.

So there is no direct Filemaker Function that will do this?

The native Filemaker way is to use a summary field sCount defined as Count of [Division].  Next, define a calculation field (result is Number) =

GetSummary ( sCount  ; Division ) / sCount

Place the calculation field in a sub-summary (when sorted by Division) part. Records must be sorted by Division. Each sub-summary occurrence will display the percentage of the corresponding value in the found set.

 

 

There are other ways to arrive at the same result - all depends on when/where/why you need this.

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.