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

Counting

Status
Not open for further replies.

colkas

IS-IT--Management
Aug 26, 2003
39
SE
Hi

I created a formula that displays 1 if a date range is true and 0 if it is not true.

This works, but what I want to do is count all 1 and then all 0 and this dispayed as a total of 1 and 0. No matter what I try I cannot get a total count.

Can someone advise please, thanks in advance
 
You could do a sum of the formula field to count the 1s and then a count minus the sum to count the zeros. This is the only way I can think to do it without creating more formulas.
 
A count of your formula will give you the total count:

count({@yourformula})

If you have a group and want a group summary, use:

count({@yourformula},{table.groupfield})

If you want to count only the 1's you would use:

sum({@yourformula})

If you want to count only the 0's, you could use:

count({@yourformula})-sum(@yourformula})

Or, you could create another formula {@zeros}:

if {@yourformula} = 0 then 1

And then sum this new formula:

sum({@zeros})

-LB
 
Hi

Thanks lbass this worked great, I also made a big error in making the 1 and 0 text and not numbers but I used your forumual ideas after and I now have the results I need.

Thanks to all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top