Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing a count of the number of records based on some criteria

Status
Not open for further replies.

SamuelBiddulph

IS-IT--Management
Jun 17, 2003
50
0
0
US
Being a somewhat 'newbie' to the world of Filemaker i'm sure this is an easy question.
I've created a smile database that logs support calls, basically on the 1st layout i have a counter that displays the total number of records in the database - this works well and goes up as new records are created.
What i want to be able to do is to also display the number of records that are currently in the database that are marked as not being closed (told you it was easy!).

How do i go about doing this. Any help would be great!!
 
If you always have all records in your found set, it is simple.
Define two fields -
ClosedFlag Calculation Case(not closed, "X", "")
DisplayCount Calculation Count(ClosedFlag)
Count returns the number of non-blank occurrences.
If you only have some records in the found set, you need to do a self-join. I won't go into the details unless you do need it.


Cheers,
Paul J.
 
Thanks for your advise - i'm having a few problems with getting anything to display though. I'll always be using all the records in the database at the time the calculation is done so i don't think i'll need to self-join.

What i have is the following;

The field name is Status
The info in that field i want to find is the word Closed

So following your example i created two fields;

ClosedFlag Calculation Case(not Status, "Closed", "")
DisplayCount Calculation Count(ClosedFlag)


And on my layout i displayed the field DisplayCount - but it's blank.

Any ideas what i'm doing wrong?
 
Is 'Status' a binary field?
I think what you need is -
SomeField Text either "closed" or "open"
Status Calculation case(Somefield = "Closed" , "X", "")
DisplayCountCalc Count(Somefield)
I've just had a very pleasant reunuion luch so my logic might be a bit odd but ... I think you'll see the idea.

Cheers,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top