You can calculate values in the control break and page footing specifications and include the results with the footing text. The $CALC function performs the calculations.
For example, two columns in the CUSTOMER table, OPEN$ and YTDSALES, can compute the difference between the outstanding balance after processing the current orders and the previous outstanding balance. The calculation is coded for the control break footing on the Heading fill‑in. The value prints when a level‑1 control break, based on state, occurs. The calculation is specified as:
$CALC ( $TOT(CUSTOMER.YTDSALES) ‑ $TOT(CUSTOMER.OPEN$) )
When specifying $CALC, you can specify any valid arithmetic expression. The expression can include parenthesis, operators, report functions, field names, and numeric values. All fields and functions must be numeric. Field names must be unique names or labels defined in the primary detail group.
Valid operators include the following:
‑ * / $SQRT
Note: You can use $CALC to calculate the standard deviation. For example, to obtain the standard deviation for the value in OPEN$, a field containing the outstanding amount owed for each customer, a labeled detail expression is specified on the Detail fill‑in as the following:
OPEN2 = OPEN$ ** 2
The calculation in the footing on the Heading fill‑in is specified as the following:
$CALC ($SQRT($OCC(OPEN$) * $TOT(OPEN2) ‑ $TOT(OPEN$) * $TOT(OPEN$))
/ $OCC(OPEN$))
Be sure to define an EDIT PATTERN large enough to hold the largest expected value.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|