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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count on a conditional formula

Status
Not open for further replies.

veles

Technical User
Sep 1, 2006
57
CA
Hi,

I have 2 tables that I am setting the condition:

{type} = "weather"
{cond} = "snow"

I created a formula ({type} = "weather" and {cond} = "snow")
the result is true and false
How do I count all true and all false
The counts are for the footer of a group called Region.

So in footer region "east"
count of true count of false
 
I see two possible options.

Method 1
Assuming the formula you created above is named {@IsSnow}, create two formulae:

{@WithSnow}
If {@IsSnow} then 1 else 0

{@NoSnow}
If not {@IsSnow} then 1 else 0

Sum these to get your counts.

Method 2
Create two running totals.

Select the field you want to count.
Reset on change of Region group.
Count based on formula - either "{@IsSnow}" or "not {@IsSnow}"

Method 1 is easier if you want to use the counts in other groups or for grand totals. However, it won't get you a distinct count if you have duplicate data.

Method 2 allows you to do a distinct count, but you'll have to create a running total for each group level where you want the count to appear.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks,

I got it working using method 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top