Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Calculation question...

edited November 2001 in General
Hi, here i go again with calculation questions:
I have something like this:

Detail band:
Field1 Field2 Field3 DetVariable
Group footer:
FootVariable
Summary:
SumVariable

An need this odd calculation:
DetVariable = (Field1*Field2) / SUM(Field1*Field2*Field3)
FootVariable = SUM(DetVariable) for the group
SumVariable=SUM(DetVariable) for the report

Is there a way to acomplish that?
thanks
--
Guillermo Castaño Acevedo
Gerente de Sistemas - Grupo Millennium Ltda
GuillermoC@GrupoMillennium.com
www.GrupoMillennium.com

Comments

  • edited November 2001
    A clarify in the detail variable included.
    Hi, here i go again with calculation questions:
    I have something like this:

    Detail band:
    Field1 Field2 Field3 DetVariable
    Group footer:
    FootVariable
    Summary:
    SumVariable

    An need this odd calculation:
    DetVariable = (Field1*Field2) / SUM(Field1*Field2*Field3) .... SUM
    for the group
    FootVariable = SUM(DetVariable) for the group
    SumVariable=SUM(DetVariable) for the report

    Is there a way to acomplish that?
    thanks



  • edited November 2001
    You'll need to use TppVariable components for this calculation. You'll need
    at least on in the detail band, one in the group footer, and one in the page
    footer. Use their OnCalc events to create the sums. The variable component
    can be set to reset when a group ends/starts. See the Timing dialog to
    control this by right clikcing over the variable in the designer.

    Variables can be set to Visible = False and they will still calculate their
    OnCalc event. You can control the order in which their OnCalcs fire through
    their CalcOrder property. This will ensure that you can calculate the
    numerator and denominator before your main OnCalc calculation fires.

    Access the datapipeline field values directly for the calculations:
    Value := plOrders['Amount Paid'] * plOrders['Amount Paid'];

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.