[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Crystal reports formula

Posted on 2011-09-23
8
Medium Priority
?
341 Views
Last Modified: 2012-06-27
Hello,

I have a formula that is not working.  This formula is returning a value of 0 when it should be 0.19.

(DistinctCount ({qryCOQ.CSIID}, {qryCOQ.CSIIssueDepartment}))/(DistinctCount ({qryCOQ.JobNumber}, {@Date}, "monthly"))

I ran each section by itselt and the results were:

DistinctCount ({qryCOQ.CSIID}, {qryCOQ.CSIIssueDepartment})  = gave me 16
DistinctCount ({qryCOQ.JobNumber}, {@Date}, "monthly") = gave me 84.

Maybe I need to use the EvaluateAfter() command?  I tried it though, and it gave me zero also.  I might not be using it right.  

Thanks,
Joel
0
Comment
Question by:Genius123
[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
  • 4
  • 2
  • 2
8 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 36591143
You are doing integer division

(CDbl(DistinctCount ({qryCOQ.CSIID}, {qryCOQ.CSIIssueDepartment})))/(DistinctCount ({qryCOQ.JobNumber}, {@Date}, "monthly"))

Another thought is check the formatting to ensure you aren't formatting with 0 decimals or rounding to 0 decimals

mlmcc
0
 

Author Comment

by:Genius123
ID: 36591398
It was the number of decimals.  You are the man.  Or woman?!

Thanks,
Joel
0
 

Author Comment

by:Genius123
ID: 36599438
I've requested that this question be closed as follows:

Accepted answer: 0 points for Genius123's comment http:/Q_27325309.html#36591398

for the following reason:

Thanks.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 35

Expert Comment

by:James0628
ID: 36591998
mlmcc,

 I know that this may not be important, since it wasn't the problem, but why did you say that his formula was integer division?  Am I missing something?


 Genius123,

 If you got the idea to check the number of decimals from mlmcc's post, then you should accept his post as the solution and award him the points.  If you found it on your own before you saw his post, then you should mention that, just so that we know (of course you could still award him the points for trying to help, but that's up to you).

 James
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36592889
It was just a thought since they were both counts and integers.  I have been doing a lot of VB programming and then it matters.  Crystal probably handles it differently.

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 36592919
CR doesn't make the result of a calculation integer just because the values in the calculation are integers.  I thought just maybe I was missing something, like maybe using DistinctCount in the calculation was affecting the results, but I don't think so.

 James
0
 

Author Comment

by:Genius123
ID: 36599439
Accidentally closed.
0
 

Author Closing Comment

by:Genius123
ID: 36599442
It was the number of decimals.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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