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!

Count if string value = ? 1

Status
Not open for further replies.

timmahan

Technical User
Apr 23, 2007
18
US
Report uses only one table "sales"
Grouped on Zip Code (top 10 Etc)
In a field named "newused" there is either an "N" or a "U"

I simply want to count how many N's and how U's in each Group

I was able to get answer but had to use 3 formulas

Formula1=@Count New
if {sales.newused}="N" Then 1 Else 0

Formula1=@Sum New
2-Sum ({@Count New},{sales.zip})

and then have to do that AGAIN for "U"

Is there a simpler way ??

something like if {sales.newused}="N" Then Count ? (the N's)
and same thing for U's

 
You can skip the second formula. Just place your first formula in the detail section and right click on it and insert a sum(not a count) at the group level.

-LB
 
You could also do a running total with {sales.newused}="N" as the formula test. If you're not already familiar with Crystal's automated totals, see FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top