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

Counting Formula- Won't count based on specific status

Status
Not open for further replies.

kineo1

Technical User
Jun 3, 2005
12
US
Hi All,
This is my first post here, although I've been reading up for a bit. I've found some helpful hints, but I'm still stuck. I'm fairly new with Crystal Reports, and have not had any education, just what I've figured out myself or read up on from help files, so please be kind.

I'm creating a report that reads from 3 different databases (INCIDENT_STATUSES, INCIDENTS, and REPS). The idea of the report is to monitor the incidents currently assigned to a rep. A simple cross-tab table doesn't break out all the information I need, so I'm linking data right onto the report. I've created a group for each rep to display the types of data I need. I have a count of total incidents assigned to the rep so far, but now I want to break it down further and do a count of only incidents that are in an open status: which are statuses 2,3,and 4- where status 1=closed.

My formula so far is:

//counts number of open tickets
if
({INCIDENTS.ID_STATUS})>= 2
then
Count ({INCIDENTS.NUMBER})

The problem I'm having is that, it counts ALL tickets, not just open tickets. I may not be understanding the logic here, but for some reps it shows 0 records and for others is shows 7,321- which is the complete total amount of all incidents in the database.

Does anyone know what I'm doing wrong here? Thanks ahead of time for any help you can offer.
 
Hi,
Try using this formula in the details for the rep:
@countIt
Code:
If {INCIDENTS.ID_STATUS}>= 2
then 
1 else
0

Then Insert a SUM of this formula in the rep GH or GF
It will add up to the # of open incidents
( you can supress the display of the formula )



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks Turkbear! That was a great idea. It didn't quite get me what I was looking for, but it's a huge step forward. I now have a count of total tickets per rep instead of a grand total of all tickets. But it's still also counting closed tickets.
 
Looking at the data it seems to be including tickets with a status of 1 and a status of 3 for some and 4 for others... really odd. I'm not quite sure why it would do that.
 
Ahh, I figured out that I had incorrectly thought a status ID of 2 = open, however ID of 2= closed! I'm on the road to victory! Thanks again Turkbear, your idea is superb!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top