Solved

How can I ignore 0 values from Crystal Report .

Posted on 2004-03-28
7
1,580 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
ID: 10701890
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
ID: 10702262
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
ID: 10704285
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
ID: 10712117
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
ID: 10738546
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Infragistics UltraGrid - Export to Excel 2 185
Crystal Reports Date Calculation 10 47
Cyrstal Reports formula to check IsNull 8 43
Possibly a grouping issue? 7 36
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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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 antispam), the admini…

733 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