[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How can I ignore 0 values from Crystal Report .

Posted on 2004-03-28
7
Medium Priority
?
1,762 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
5 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

831 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