Summarize excluding suppressed values

Posted on 2004-10-28
Last Modified: 2012-08-13
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?
Question by:holdsworthbros
    LVL 13

    Assisted Solution

    You can use the 3 formula method to create a manual total:

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

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

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

    LVL 42

    Accepted Solution

    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).

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



    Expert Comment

    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

    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?

    Author Comment

    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.

    Expert Comment

    OK Thanks!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    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. …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now