?
Solved

Crystal reports formula

Posted on 2011-09-23
8
Medium Priority
?
336 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
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 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