Print Page | Close Window

Simple Counting Formula

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21532
Printed Date: 30 Apr 2024 at 11:26pm


Topic: Simple Counting Formula
Posted By: ClantonC
Subject: Simple Counting Formula
Date Posted: 09 Jun 2015 at 5:16am
I know this is simple but I am still a newbie (I am however good at excuses!)

I need a record count formula. I need a count of all {Warrant.Warrant_Type} that = “WA” but that also where the {Warrant.Warrant_Disposition} = “Active”. It accepts this without error but only generates a “0” value on the report.

Does this make sense?



Replies:
Posted By: kevlray
Date Posted: 09 Jun 2015 at 7:19am
So I am assuming that you are using a running total (count) and have a formula to evaluate when to evaluate.  Something like this:

{Warrant.Warrant_Type}= "WA"
and {Warrant.Warrant_Disposition} = “Active”

And this assumes that you have data that meets the criteria.


Posted By: ClantonC
Date Posted: 09 Jun 2015 at 7:41am
Yes I do. We keep a list of all warrants active or complete (Still pending service and already served). I am trying to do a running count or each type of warrant separately (Arrest Warrant, Bench Warrant, and Courtesy Summons Warrant).

Until I get this worked out I am running a report that filters out all "Complete" and groups by type with a total between groups.


Posted By: niha
Date Posted: 09 Jun 2015 at 9:40pm
{Warrant.Warrant_Type}= "WA"
or {Warrant.Warrant_Disposition} = “Active”

try or instead of and


Posted By: ClantonC
Date Posted: 10 Jun 2015 at 4:57am
It still gives a 0. Would that not wind up giving a count for all warrant types that are active?


Posted By: kevlray
Date Posted: 10 Jun 2015 at 7:08am
Without knowing the data and how you set up the running total (or formula) -detailed information.  It will be difficult to know what the issue is.


Posted By: ClantonC
Date Posted: 10 Jun 2015 at 8:31am
Table:
     Warrants
Fields:
     Warrant Type
          AW – Arrest Warrant
          BW – Bench Warrant
          CS – Courtesy Summons Warrant

     Warrant Disposistion
          Active – (Still trying to serve)
          Complete – (either served by officer of canceled by clerk of court)

I want to put a record count of each “warrant type” that is set as “active” in the {Warrant Disposition} Field in the database.
I have a report that lists all active warrants and I have them grouped it by {Warrant Type} with a count at the end of each group. I just wanted to put a count in the report header so that I no longer needed to group the warrants by type. The report is easier for the officers to use when it is not grouped.


Posted By: kevlray
Date Posted: 10 Jun 2015 at 12:46pm
It looks like you do not equal signs but use the startswith.

{Warrant.Warrant_Type} startswith "AW"
or {Warrant.Warrant_Disposition} starswith “Active”

FYI:  I noticed that the warrant type starts with an AW not WA


Posted By: ClantonC
Date Posted: 11 Jun 2015 at 4:23am
I am not sure why I didn't think to do it like that. I will give it a try! Sorry It used to be set to WA but to make it more uniformed I switched it to AW. Old habits! ;) Thank you very much for your help!

PS. So I do need to use "or" instead of "and" ?


Posted By: kevlray
Date Posted: 11 Jun 2015 at 5:02am
Opps!  Probably should be an AND since you only want to count when the Type starts with WA and the Disposition starts with Active.



Print Page | Close Window