Summarize excluding suppressed values

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?
holdsworthbrosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vidruCommented:
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
frodomanCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eluhCommented:
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
holdsworthbrosAuthor Commented:
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
eluhCommented:
OK Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.