Print Page | Close Window

Suppressed data Inc in Sums

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19895
Printed Date: 05 May 2024 at 5:18am


Topic: Suppressed data Inc in Sums
Posted By: adders
Subject: Suppressed data Inc in Sums
Date Posted: 16 Aug 2013 at 1:24am
Hi,

is it possible to exclude suppressed lines from a sum?

Currently have a running total for the record count, I also have a boolean formula to select true where the count is less than 10, however in the running total I'm unable to select records based on that formula?

Thanks



Replies:
Posted By: DBlank
Date Posted: 16 Aug 2013 at 3:09am
you cannpot use a RT as a condition on another RT as they evaluate on the same pass.
YOu can use a summary in an RT.
I assume you have a grouping. You are doing a record count in the group and you want to do a count of the groups (or all records in groups) where the original count is > 10.
Try using an insert summary as a COUNT(field,groupname) to get your first number which can be used in the RT as an evaluate condition.


Posted By: adders
Date Posted: 16 Aug 2013 at 4:43am
Thanks for the quick reply!

have managed to do a count based on boolean values, however I know have the other 3 columns to try and bring only the first 10 records out! Is there away just to tell crystal reports to bring the top 10 results of each group rather than suppressing all the data?

If not I guess more formula writing is needed!


Posted By: DBlank
Date Posted: 16 Aug 2013 at 5:03am
you can use the a top 10 but not sure how it wouild handle boolean ?
Can you explain or show sample data of what youw ant it to do?
Also remember that suppressed data ius still in the  report and is including in all calculations unless you explicitly exclude it.


Posted By: adders
Date Posted: 19 Aug 2013 at 4:44am
Image of report included, you'll see the three sums I'm currently showing, I only ever wont them to show and use those line that are true.

Thanks




Posted By: DBlank
Date Posted: 19 Aug 2013 at 8:25am
You can use shared variables to do this
 
you need one to set th valus to 0 in the group header
//header
shared numbervar counter;
shared numbervar amount;
counter := 0;
amount := 0;
 
you need another to do the row level calculation
//details
shared numbervar counter;
shared numbervar amount;
counter := counter + 1;
amount := if counter<11 then amount + {table.field} else amount;
 
then a third to display your final value in the group footer
//Footer
shared numbervar amount;
amount;



Print Page | Close Window