1 Reply Latest reply on Feb 5, 2015 8:17 PM by philmodjunk

    Calculation vs Summary



      Calculation vs Summary


      Dear Wizards,

      Fld A has repeated and random letters i.e. a,b,b,c,a,a,c,b,c,b,c

      Fld B has amounts

      I’d like the record of each Fld C to be the total (not running) of the Fld Bs that are associated with the letter in Fld A.

      I’m guessing calculation (? or summary ?) but can’t think of how to state it.



        • 1. Re: Calculation vs Summary

          Are all three fields defined in the same table?

          Assuming that this is the case, set up a self join relationship:

          YourTable::fieldA = YourTable 2::FieldA

          Then fieldC can be defined to evaluate from the context of YourTable:

          Count ( YourTable 2: FieldA )   // any field from YourTable 2 that is never empty will produce the same result here

          The same Count can be produced in an ExecuteSQL() function call and then no added table occurrence is needed in your relationship graph:

          ExecuteSQL ( "

          SELECT Count ( \"FieldA\" ) FROM \"YourTable\" WHERE \"FieldA\" = ? "

          ; "" ; "" ; YourTable::FieldA )