Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to count certain records from a summary within Crystal reports

Posted on 2009-12-17
3
Medium Priority
?
670 Views
Last Modified: 2012-05-08
Hello, I am trying to create a custom formula that counts record summary above a value of 1.  For example I have a report now that shows a reference number and then the number of units assigned to the reference number.

sample of data in the report:
Number 99-075380             Number of units  1

Number 99-075382            Number of units  3

Number 99-075383            Number of units  1

Number 99-075385            Number of units  1

Number 99-075386            Number of units  2

What i am trying to achieve is creating a formula that will evaluate the group summary and if the number is greater than 1 count it  So in the above example I would get a return of 2 since I have two number that have more than 1 unit.

I have tried this using Do While and if then statements but I don't feel that my syntax is right as I always get a fixed value return of 1

I'm not even sure if you can get CR to automatically increment a number variable based upon an evaluation of a count.

Any help would be appreciated.

Thank you
0
Comment
Question by:r_crews
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
ravenblue earned 2000 total points
ID: 26075699
you should be able to do this in a simple running total.

In the running total dialog;

Set field to summarize to the reference field.
Set type of summary to count
under evaluate select use formula and enter a formula of

     {units} >1

then (assuming this is in a group footer) set the 'reset' to 'on change of group' and select the correct group.

Drop this running total into the group footer.
0
 
LVL 1

Author Comment

by:r_crews
ID: 26077039
ravenblue

I tried your solution but I never was able to get an accurate return. I think one reason is due to the fact that Units is not a physical database field but a summary that counts units assigned to the reference number. ( think of this as units that a person may purchase per transaction) The reference number is a Group header and then within that group footer is the count of units assigned to the reference number.
 
Using the running total I am getting a return of 35 where the number should be 23. I changed the evaluation formula to
(Count ({CALLUNITDATA.Unit}, {Active_Calls.Call_Number})) >= 2
AND
(Count ({CALLUNITDATA.Unit}, {Active_Calls.Call_Number})) <> 1
;

as well as well as testing your first suggestion
(Count ({CALLUNITDATA.Unit}, {Active_Calls.Call_Number})) > 1;

In both situations I still get the same number returned.  I have tried using this formula in both the group footer as well as in the report footer and I still receive the same results.

Thank you
0
 
LVL 1

Author Closing Comment

by:r_crews
ID: 31667534
Thanks for pointing me in the right direction. I changed the formula count type to DisticntCount and set the evaluation type formula for DistinctCount > 1.

The formula appears to be tracking the counts correctly.

Regards,
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question