Thu Jan 28 1999

ARMRCALC

Subject: ARMRCALC09

Function: line_sum(y)


x=line_sum(y)

Purpose

Use the line sum function to summarize numerical data over a specified columnar view. Recall that an ARMR data view of a given set of fields shows us only the unique combinations of the specified fields' values. Redundancies are not shown. Nevertheless, we do track the clones of each displayed line.

For each displayed line, line sum returns the sum of a given data field over the line's clones.

Example

Assume that among the fields of a general ledger data base are Year, Month, DEBIT, CREDIT, CumDebit, and CumCredit.

In a given Year and Month we find any number of records with entries in DEBIT and CREDIT.

We wish to generate running sums for DEBIT and CREDIT at monthly resolution. The line sum function together with the previous function allow us to build CumDebit and CumCredit.

The following calc program generates the desired sums:

      columns= Year Month

      calc_start=
         CumDebit= prev(CumDebit)+line_sum(DEBIT)
         CumCredit=prev(CumCredit)+line_sum(CREDIT)
      calc_end=