Solved

Crystal reports formula

Posted on 2011-09-23
8
289 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
  • 4
  • 2
  • 2
8 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
Comment Utility
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
Comment Utility
It was the number of decimals.  You are the man.  Or woman?!

Thanks,
Joel
0
 

Author Comment

by:Genius123
Comment Utility
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
 
LVL 34

Expert Comment

by:James0628
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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 34

Expert Comment

by:James0628
Comment Utility
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
Comment Utility
Accidentally closed.
0
 

Author Closing Comment

by:Genius123
Comment Utility
It was the number of decimals.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

10 Experts available now in Live!

Get 1:1 Help Now