Jump to content

Script or similar to count number of records...

Recommended Posts




I'm new here and I'm sorry to bother you when you've probably already answered this question a million times, but I've searched on here and found something similar although I can't make it work in my instance.


I'm currently producing a database in FM7 for use as a Newsdesk for a Communications Team of 15 staff. They log all the calls they receive and ultimately need it to be able to produce monitoring reports periodically. These will need to show how many calls there were for a certain field eg. "Comms Officer", region, district, call type, subject, date etc. I've created a script that will find all the relevant calls (and obviously the total is detailed in the status area when the script is used) but I'm struggling to find a way of producing an actual report that will list each of the fields with the number of calls in each area?


eg something like this:

Comms Officer "John Doe" Total for January = 160

Comms Officer "Jane Doe" Total for January = 94


Does anyone have a script that I can use to calculate this please? I've tried looking through the "specify calculation" table but I can't make any sense of it. My knowledge is not too bad, though I'm completely self taught so there are a few areas I'm not entirely sure of - this being one of them :o


Thanks in advance for your help.


Share this post

Link to post
Share on other sites

There are a few ways to accomplish this.



Is a blog entry from Weetbixs that is a really slick way to get a count.


But the fundamentals (other methods than the slick way from the blog post above :)


This can be accomplished as a result of a FIND and then a GET (FOUNDCOUNT) command.

THIS requires the running of a script.


It can also be accomplished using a child self-join table occurrence (TO), related through a global variable, where the child table results in being filtered by the content of the parent side global field, then a calculated field in the parent, using the COUNT (fieldname) command as the calculation. Count calculations must be from the parent side - outside looking in, as it were.


SO, say you set a parent side global field to "John Doe", matched to the COMMS OFFICER field in the child table.

The child table, and the fields from the context of that child table, are filtered by the relationship to be ONLY those for John Doe. THEN the parent count field can count the child records.


Different self-join TOs can be used for different things you want to count.


THIS approach just happens automatically.


So there are multiple ways to "skin that cat"

Share this post

Link to post
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