Solved

I have a crystal percentage formula issue

Posted on 2014-07-21
5
295 Views
Last Modified: 2014-07-25
I want the this formula to return a %.  Like 14%,  It comes back now 0.14%

if Sum ({@Cashless}, {points_of_sale.code}) = 0 then
    0
else

if Sum ({Vend_Visits.total_revenue}, {points_of_sale.code}) = 0 then
    0
else

Sum ({@Cashless}, {points_of_sale.code})/Sum ({Vend_Visits.total_revenue}, {points_of_sale.code})
0
Comment
Question by:evend
[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
  • 2
5 Comments
 
LVL 8

Expert Comment

by:5teveo
ID: 40210653
Try this syntax... here is a sample of syntax

Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })

Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
0
 
LVL 35

Accepted Solution

by:
James0628 earned 445 total points
ID: 40211183
As he posted, you can use the % operator.  Or you could multiply the result by 100.  The % operator is just a shortcut that CR provides.  X % Y is the same as X / Y * 100

 FWIW, you don't need to test Sum ({@Cashless}, {points_of_sale.code}) to see if it's 0.  If it is, the result will just be 0.  There's no harm in checking it, of course.  But it's not necessary.

 James
0
 

Author Closing Comment

by:evend
ID: 40218353
Thanks!  Multipying by 100 was easy.
0
 
LVL 35

Expert Comment

by:James0628
ID: 40219027
You're welcome.

 But, to be fair, 5teveo probably should have gotten some of the points.  His basic suggestion to use the % operator was valid, although his use of different fields in his example formula, and then explaining what that formula was doing, was kind of confusing (at least to me).  So, it may be something of a gray area.  But he did have the % operator in there.

 If you like, you can use the "Request Attention" link to ask to have the question re-opened, and then split the points between us.

 James
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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 video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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