"Count" Statement In Formula (1 Viewer)

lhooker

Registered User.
Local time
Today, 12:50
Joined
Dec 30, 2005
Messages
399
I would like to create a report that creates totals for each individual salesman (Group #1). The criteria is determine by a "LIKE" statement (i.e. LIKE "*Port*"). I need the total amount and the number of records for
each salesman. I tried to do this in a fomula, but can't seem to get the right total for the number of records. It's counting every record. How can I count the number records that meets the specified criteria ? Below is an example of the formula for counting the number of records:

If ({itemtype.Description} like "*Port*") Then
Count({itemtype.Description})
 

Brianwarnock

Retired
Local time
Today, 17:50
Joined
Jun 2, 2003
Messages
12,701
Started to answer this then realised it was Crystal Reports which I've never done, but as the problem appears to be the same as in ACCESS queries is this a case of when a sum is required

eg Sum(test criteria,1,0))

Sum (If ({itemtype.Description} like "*Port*", 1,0)) maybe
Brian
 

Kempes

Registered User.
Local time
Today, 17:50
Joined
Oct 7, 2004
Messages
327
You need to add your selection criteria to include what the report needs to display. In your case, select the field, then define the criteria (*port*).
Next, right click on the value you wish to summarise, and go to summary, select the field you wish to group it by (eg, your salesmen), and hey presto, problem solvled. (in theory). It should group each salesman and give the total for each.
 

wcelenski

New member
Local time
Today, 12:50
Joined
Aug 3, 2007
Messages
5
I would recommend using a Running Total. The reason is because you can choose the field you want to summarize, and use a formula on how you want to evaluate each record. You can also choose if you want to reset the total, if ever.

It is a very easy and straight forward method of summarizing, and it will definitely work for your situation.
 

Users who are viewing this thread

Top Bottom