Solved

How can I ignore 0 values from Crystal Report .

Posted on 2004-03-28
7
1,469 Views
Last Modified: 2006-11-17
Hi ,

I have a database in MSAccess 2000 and VB programme .
And Also I have created Summary report using Crystal Report 8.5

There I have 3 values .

Ex . A1 = 50 , A2 = 0 A3 = 25
     
Using this I want to get Max of A = 50 and Min of A = 25 and Avg of A = 37.5 to take this values I want to ignore A2 = 0 .

Please help me to ignore 0 values from crystal report . But 3 records should be there .

I am Not Mean "<>" symbal . If I use this I can't take Total records are as 3 .
0
Comment
Question by:PChandima
7 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 168 total points
Comment Utility
Hello PChandima,

You will have to create your own formula fields to calculate the statistics.

MySum:(in detail line)

Global numbervar vSum;
Global numbervar vCount;
if A<>0 then
(vSum := vsum + A
vcount := vcCount +1
)

Then where you want the average:

MyAvg:
Evaluateafter(Mysum);
Global numbervar vSum;
Global numbervar vCount;
If vCount <>0 then
vsum/vcount
else
0

Minimum also needs to use a formula:

MyMin: (in detail line)
numbervar vMin;
if A<>0 and A<vMin then
    vMin := A
else
    vMin:= vMin;
vMin

Pete
0
 

Author Comment

by:PChandima
Comment Utility
Where should I Declare this vSum , vCount variables . I tried this in formula section . But It gave me froblem saying "The ) is missing" . After Declaring This variables How can I Call MyAvg and MyMin .

Please Help Me .

Thanks

Chandima.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 166 total points
Comment Utility
Variables are declared in formulas.

Create a formula
Open the report
Display the field tab or Click INSERT --> FORMULA
Right click on FORMULA
Select NEW
Name - RptDecls
global numbervar  vMin:= 0;
global numbervar  MyAvg := 0;
global numbervar  vMax:= 0;

Save the formula

Formulas are "called" by inserting them just as you do a database into the report.
Put RptDecls in the Report Header

Create the other formulas the same way and put them in the detail section.

mlmcc

0
 

Author Comment

by:PChandima
Comment Utility
No I want to Add these summeries , Average , Minimum and Maximum values to one group header . I want to show these values only . And also I want to hide details section . All the report details I have added to the group header section .

Please Help me .
0
 
LVL 4

Assisted Solution

by:kssaran
kssaran earned 166 total points
Comment Utility
For Simple Ease of use. You can create one Formula Column and assign the value as either one or Zero depends on the value of A2

it is like goto
INSERT --> FORMULA
Right click on FORMULA
Select NEW
Name - intAvgCount
include the following condition

IF (A2=0) THEN
0
ELSE
1

Drag & Drop this formula Column in the details area make it as hidden.

At the Group Summary level Take the Sum of this Formula Column You will get the count for those which A2 is not Zero then you can sumup the value of A2 and Divide by this Value to get the average

I hope you got it right this time

Happy Coding
:)


0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now