[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Summarize excluding suppressed values

Posted on 2004-10-28
5
Medium Priority
?
1,039 Views
Last Modified: 2012-08-13
Hello,
I have a formula which adds two numbers (Call this field @Electronic). These numbers then have a (sum) summary created from them (@Electronic for a given day, selected by date). I have suppressed some values (duplicates), but the summary includes the suppressed values. Is there any way of asking the program to exclude suppressed values?

I have tried inserting the suppression formula into the ElectronicPayments formula (this formula compares the order number from this record, to the previous record and returns 0 if they are the same)

If (Previous({orderhea.ORDER_NUMBER}) = {orderhea.ORDER_NUMBER})
    Then 0
Else {paydetls.CREDIT_CARD}+{paydetls.EFTPOS}

But then I cant summarize the field anymore! (Error: This field cannot be summarized) ARGH!

I even tried a running total, with the formula and it didnt work.
Can you help?
0
Comment
Question by:holdsworthbros
5 Comments
 
LVL 13

Assisted Solution

by:vidru
vidru earned 680 total points
ID: 12441446
You can use the 3 formula method to create a manual total:

//@Init
//Place this formula wherever you want to reset the summary variable (e.g. GroupHeader)
WhilePrintingRecords;
NumberVar Electronic := 0;
"";

//@Increment
//Place this where your current formula is (likely a Details section)
WhilePrintingRecords;
NumberVar Electronic;
If (Previous({orderhea.ORDER_NUMBER}) <> {orderhea.ORDER_NUMBER}) then
    Electronic := Electronic + {paydetls.CREDIT_CARD}+{paydetls.EFTPOS};
"";

//@Display
//Place this wherever you want to display the summarized value
WhilePrintingRecords;
NumberVar Electronic;


-dave
0
 
LVL 42

Accepted Solution

by:
frodoman earned 320 total points
ID: 12442248
Dave has you on target but I'd recommend one change.  Get rid of the formula you're currently using and replace Dave's @Increment formula with this one - this will both accumulate the total and display the result as the value or as zero (essentially combining Dave's formula w/ your original one).

@Increment
WhilePrintingRecords;
NumberVar Electronic;
NumberVar Result :=0;
If (Previous({orderhea.ORDER_NUMBER}) <> {orderhea.ORDER_NUMBER}) then
    Result := {paydetls.CREDIT_CARD}+{paydetls.EFTPOS};
Electronic := Electronic + Result;
Result;

HTH

frodoman
0
 

Expert Comment

by:eluh
ID: 14237464
Hey guys,

I've got a similar issue here:
I 've got a report where I'm printing a qty for example

Order           qty
100               1
103               2

etc.
I'm using a formula to suppress certain records - so that for instance in this case the reocrd for 101,102 are suppresed.
I would like to get the total qty without the suppressed records. In this case my toal would be three.
When I run running totals, sums - it will add the qty's of my suppressed records! What can I do?
Thanks!
0
 

Author Comment

by:holdsworthbros
ID: 14237482
Hi,
I would post it as a new question rather than a comment to mine. It may not get answered otherwise.

I couldnt believe that there wasnt some simple way to tell Crystal to exclude supressed values! But it seems quite complex.
0
 

Expert Comment

by:eluh
ID: 14237499
OK Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

830 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