Page 1 of 1

Report Count fields

PostPosted: Sat Jan 17, 2015 7:32 am
by BRobinsonS
Is it possible to count the number of fields containing a certain value?

For example, in my membership software in a certain report I would like to count the number of members who are active and who are not active.
At the end of the report I would like to summarize e.g. Active = 125 InActive = 63 Total Membership = 188.

Don't see a way to do this within Report Designer.
Is there a function similar to Count(If "ActiveStatus" "=" "False") ?

Re: Report Count fields

PostPosted: Sat Jan 17, 2015 8:21 am
by Gaev
Brian Robinson:

Is it possible to count the number of fields containing a certain value?

Is there a function similar to Count(If "ActiveStatus" "=" "False") ?

I think you meant to say "number of records containing a certain value in a specified field" ... if so ...
Code: Select all
dbpQuery "yourID" "yourTable" "ActiveStatus = 1"
AlertBox "Active Count" "[ID.Table.$RecCount]"
etc. etc.


Don't see a way to do this within Report Designer.
For example, in my membership software in a certain report I would like to count the number of members who are active and who are not active.
At the end of the report I would like to summarize e.g. Active = 125 InActive = 63 Total Membership = 188.

I don't know about the Report Designer ... but you could ...

a) just write "Active = [ActiveCount] InActive = [InactiveCount] Total Membership = [TotalCount]" to a Text file ... and then print it.

b) have a Dummy Table ... e.g. ActiveInActiveCounts ... with 3 fields (ActiveCount, InactiveCount, TotalCount) ... and 1 record which is populated with [ID.Table.$RecCount] from the 3 queries ... then do a Report of this Dummy Table.

Re: Report Count fields

PostPosted: Sat Jan 17, 2015 10:22 am
by Neosoft Support
Take a look at the Formula Tool in the Report Designer. It allows you to perform simple calculations (like count) on fields. Details in the help file.

Re: Report Count fields

PostPosted: Sun Jan 18, 2015 8:45 pm
by BRobinsonS
I am using Count as in the Help file but it doesn't allow for Conditional 'counting'.

In the report summary if would like 'Count if Field = False' in one variable and other one could be 'Count if Field = True'.

Re: Report Count fields

PostPosted: Mon Jan 19, 2015 11:14 am
by Neosoft Support
To do a conditional count you would need to sort that table on that field. You could then use a group partition in the report to display the totals for each.