Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Help - Calculations


Recommended Posts

Hello. We are a counseling/therapy team providing low/no cost therapy to community members.


In our current database we ask clients information like age range, cultural heritage, and gender.


These questions are individual fields with drop down menus. i.e. age range 18-24, 25-30, 30-35 or gender male, female


How do we calculate how many male clients we that are from 18-24?


Ideally we would like to have a statistics page that summarizes all of our data that updates with each new client/intake. Meaning that we can quantify how many people fit into each category.


We appreciate any and all help! Thank you!

Link to comment
Share on other sites

The easiest way is to go to your contacts screen, go into find mode, and do a search on the two fields in question, ie put "Male" into the gender field, and "18-24" into the age range field and hit find. This will get you the set of records back of all 18-24 males and quickly tell you how many there are.


however that's no good if you want a statistics page.


Looking at just those two fields as an example try this:


Create two global fields on your table (it can be any table, but perhaps contacts is best for now). Field one will be called "Statistic Gender" and field two "Statistic Age Range".


Place both fields on your layout somewhere (perhaps on your statistics layout if you have one), and set them up with the same drop-downs , ie a gender picklist, and your age ranges.


Now, you need to establish a relationship to a new table occurrence of contacts. On your relationship graph, add a new table occurrence to the graph, call it "Contact Statistics" and base it on the Contacts table.


We are now going to establish a relationship between the Contacts table occurrence, and this new "Contact Statistics" occurrence, using the two global fields created before:


Contacts Contact Statistics


Global Gender = Gender

Global Age Range = Age Range



Next, create a calculation field on contacts called "Gender Age Stat" or whatever you want, and set it to :


Count ( Contact Statistics::Contact ID )


(where contact ID is the primary key field for contacts, but it can be any field, but make sure that field always has a value in it, like the ID field).


Now, when you select both a gender and an age range in your global fields, the calculation will tell you how many contacts you have that are both of that gender and age range. So putting in Male / 18-24 , will establish a relationship to all of those particular contacts, and the calculation will count them.




You should note that this current implementation requires both an age and gender to be entered into the globals. If you enter just a gender, ie Male, then it will not find just males. However this is possible to tweak this solution so that it will. Conversely it can be tweaked so you only need enter an age range to find all contacts regardless of gender in that age range.. If that is something you think you'd want let me know and I'll carry on to explain that part, but I'll leave it for now in case you don't need it.

Link to comment
Share on other sites

i'm only a 1/4 step above a n00b myself, but let me give how I'd do it..


you can do a simple quick query (FIND) and put in the age rate say, "18...24", and populate the gender field with "Male", and that'll return a count of all males within that number range.. you could immediately get a count from your number of returns...


IF this is a regular thing (ie., you reguarly need to return stats like this), you could also do a "Count (field)" calculation..


on the 2nd item, i'd highly recommend starting a portal with that sort of result. portals do wonders for reporting.


Consider that you don't need to statically store the results of a query, but use it for a simple report, so you're not adding significantly to the structure to do portals from other tables, with all items showing therein..


Just as in people issues, proper relationships between tables and records are the key to keeping things running smooth. smiley_cool

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Terms of Use