Mon 29 Jun, 2009 08:55 am
If anyone can help me with this I would be super happy!

In Crystal Reports XI, I need to make a sum of distinct numbers.

For example, I have the following data:

1000
1000
1000
2000
2000
2000
3000
3000
3000

Now, I want to suppress duplicate data, so now it looks like:

1000


2000


3000


The data is suppressed, but it still exists. If I run a sum of the data, I get 18000 when I really only want 6000 (3000+2000+1000). If I doo a distinct count, I get the following:
Code:1000 1
1
1
2000 2
2
2
3000 3
3
3


So, I have a distinct count to work with, but I am totally not a programmer. I need a sum that gives me the correct addition that can be placed into a running total for each group...

I figure there has to be a way where the total can be compared to the distinct count and return a zero if it's duplicated... I have no idea how though.

I have been rather unsuccessful in finding a good answer for distinct sums in crystal reports.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 1 • Views: 3,749 • Replies: 4
Topic Closed
No top replies

 
Robert Gentel
 
  1  
Mon 29 Jun, 2009 09:34 am
I don't use Crystal Reports myself, but a quick search seemed to indicate that it would require a formula because it lacks the feature natively. This page purports to describe one:

http://www.kenhamady.com/news0410.shtml
JPB
 
  1  
Mon 29 Jun, 2009 09:36 am
@McGentrix,
I'm not familiar with Crystal Reports but a similar function in other packages might look like...

sum(distinct(payments))

where payments represents the variable in your data listing.
0 Replies
 
JPB
 
  1  
Mon 29 Jun, 2009 09:37 am
@Robert Gentel,
Yikes! Now I know why I don't use Crystal Reports.
0 Replies
 
McGentrix
 
  1  
Mon 29 Jun, 2009 11:31 am
@Robert Gentel,
Robert Gentel wrote:

I don't use Crystal Reports myself, but a quick search seemed to indicate that it would require a formula because it lacks the feature natively. This page purports to describe one:

http://www.kenhamady.com/news0410.shtml



Yeah, I had found that one, but running totals in CR doesn't like variables.

I think I have a work around at this point.

Each line has a number, 1,2,3, etc.

Code:if next ({QUOTE_LINE.LINE_NO}) <> {QUOTE_LINE.LINE_NO}
then {@Quote Line Dollars}
else 0


So, this gives me an individual line dollar amount and zero's where the line number is duplicated. Now I need to figure out how to get a summation of that group as right now my new formula is not showing up as an option for a summation.
0 Replies
 
 

Related Topics

 
  1. Forums
  2. » Who knows about Crystal Reports?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.08 seconds on 11/14/2024 at 07:50:18