Solved

Adding a Percentage Comparison Formula in Crystal Reports

Posted on 2008-10-17
8
1,325 Views
Last Modified: 2013-11-15
Hi

I am very new to Crystal Reports especially when it comes to adding numerous different formulas and conditions.  
I have a report I have made which works in everyway it should including most formula except the percentage ones.  I need to find the percentage difference from 2 values.  I have created4 if, then else formula and 2 sum formula to add relevant values to gether.  These are fine.  My database contains no numerical values only string text and dates.  I created If, then else formula to add different statuses together and sum to add each of these together.  I need to create a percentage formula to caluclat edifference between the 2 SUM values but this is not working.  I tried insert summary and selecting option for percentage difference but this only gave me option to pick one field which is not the one I need.

Any ideas or pointing me in right direction

Many Thanks
0
Comment
Question by:stefone
  • 3
  • 2
8 Comments
 
LVL 16

Expert Comment

by:wykabryan
ID: 22740461
well to find the % diff, it is a simple formula.
A = 0
B = 2

if isnull(A) or A= 0 then 0
else (A/B)*100

A and B represent your fields.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22741074
That is a percentage not a difference.

I think you really need

(A-B)/B

mlmcc
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 22741107
Opps.. yeah you are right.. but my head was in the right direction.. hehehe.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 22741355
Also you should check if B is 0 to avoid a 0 divide error

mlmcc
0
 

Author Comment

by:stefone
ID: 22758574
Hi

Thanks for comments.  I am almost there but as per you comment mlmcc I do have nil values for field b.  creating the if function ho wdo i incorporate the second field b = 0 into the formula

Thanks
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 50 total points
ID: 22758707
Somethin glike

If B = 0 then
    0
else
   (A-B)/B

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
How to increase the row limit in Jasper Server.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 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

24 Experts available now in Live!

Get 1:1 Help Now