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!

help counting based on parameters 2

Status
Not open for further replies.

Charley71

Technical User
Aug 17, 2007
31
US
I need a formula that will count occurances of records that are between number ranges within a group.

For Example:

if (table.fieldname)>=1 and <=3 then count (table.fieldname)

I am just unsure of the syntax.

I am trying to create 6 "bins" of data so I can have an accurate histogram. I'm a little new to these.
Thanks
 
Be sure and list your version of Crystal...

Try this

create a formula:
if (table.fieldname)>=1 and <=3 then = 1 else 0

insert a summary for the group or grand total that sums that formula



_____________________________________
Crystal Reports XI Developer Version
 
That doesn't work either. It doesn't like the <=3 portion. It gives me an error that it should be a number, boolean, currency, etc.
 
if (table.fieldname)>=1 and (table.fieldname)<=3 then = 1 else 0
 
Still no luck. This is what is entered in the formula and my fieldname is a formula as well. I am using crysal reports version XI.

if ({@MEGUsage})>=1 and ({@MEGUsage})<=3 then=1 else 0

It doesn't like the "=" sign now. It is the same error message as before. Maybe I am making this to hard? I just need to count occurances of records that are within ranges. The ranges I need are .1, 1, 2, 3, 5, 10, then I will create a Histogram that will show the # of records within those bins. Is there a better way? Thanks.
 
I was that last '=' sign.

if ({@MEGUsage})>=1 and ({@MEGUsage})<=3 then 1 else 0

Andy
 
whups sorry ... I was assuming your 'and' formula was correct without reading it .... point was to create a 'flag' field that results in 1 if true and 0 if false then sum it at the end...

_____________________________________
Crystal Reports XI Developer Version
 
Easier to do as a running total with
Code:
(table.fieldname) in [1, 2, 3]
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