Crystal Reports X - multplying each data item by previous value

Posted on 2007-07-28
Last Modified: 2008-01-09
Crystal Reports version X.  Looking to multiply each data item by previous as in a regular sum in a running total.

When adding  works as expected:

global numberVar mult:=mult+{@ReturnFactor}

When multiplying - returns zero:

global numberVar mult:=mult*{@ReturnFactor}

I have tried the following per a previous posting with the same results.

global numberVar mult:=0;

global numberVar mult:=mult*{@YourFormulaField}

global numberVar mult;

Any thoughts would be appreciated
Question by:rk2517
    LVL 77

    Accepted Solution

    I don't know what @returns factor does so this might not be on the mark.

    But when you need to use the value from the previous record you need to test for the current record  being the first record and not do the calc for that record:

    global numberVar mult;
    if not Onfirstrecord then
    mult:= mult* somevalue
    LVL 3

    Expert Comment

    you can use previous

    create a formula  eg, name myrunning total

    formula contains

    previous (<<Your Field Name>) *{@YourFormulaField}

    Please check   previous (<<Your Field Name>)  as null in case of first record
    LVL 100

    Expert Comment

    To test for NULL on a previous record use PreviousIsNull not IsNull(Previous({ }))


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    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…
    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…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    737 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

    21 Experts available now in Live!

    Get 1:1 Help Now