Solved

Crystal reports formula

Posted on 2011-09-23
8
332 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 250 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: 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.

 
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

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

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 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