?
Solved

How can I ignore 0 values from Crystal Report .

Posted on 2004-03-28
7
Medium Priority
?
1,646 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 672 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 101

Assisted Solution

by:mlmcc
mlmcc earned 664 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 664 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

771 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