You are here: Field Rules Reference > Field Rules Summary > AccumulateVariableTotal

AccumulateVariableTotal

Use this field level rule when you need to sum a variable from more than one occurrence of a particular record type. This rule only works with the Record Dictionary.

Syntax

(output format) AccumulateVariableTotal (Record,Variable,Cond)

Parameter

Description

Record

Name of the record pointer defined in the Records group of the Record Dictionary file (entitled DataDict). This record pointer defines the column to search, the text to look for in the starting column, and option flags.

Variable

Name of the variable pointer defined in the Variables group of the Record Dictionary. This variable pointer defines offset into the record where the data to be accumulated is located, the length and type of the data, and formatting flags.

Cond

(Optional) Name of the condition defined in the Conditions group of the Condition table. The condition consist of combinations of comparisons, parenthesis, ANDs, and ORs to verify the correct results.

To format the output, you can also include any of the following format options in the Mask field on the field’s Properties window in Studio. Separate each option with a comma.

Option

Description

- (one dash)

If the number is negative, this option places a minus sign (-) in the left most position. For example, if the format mask is (9.2,12.2,C,$,-), the result is: “- $2,100.00”.

- - (two dashes)

If the number is negative, this option places a minus sign (-) immediately before the amount. For example, if the format equal is (9.2,12.2,C,$,--), the result is “ -$2,100.00”, with a full length of 12.

+

Tells the system to always include a sign with all numbers.

%

Appends a percent sign (%) at the end of the number.

$

Adds a dollar sign. Cannot be the first character in the format mask. This limitation arises from the Move_It format option, where a dollar sign ($) in the first character of the mask means to perform a sprintf.

C

Adds commas.

C**

Adds commas if in US English format or spaces if in Canadian French format.

CR

Appends CR to the end of the number.

CS1

CS2

CS731

Enter one of these options to indicate the checksum method.

The system appends a check digit (mod 10) of 0 through 9 to the end of the number. This is typically used in accounting to make sure a number, such as an account number, is correct by performing a formula on each digit. For details, see Checksum Methods.

D

Dollars (a combination of B, C, and $. You must modify GEN_FMT_FmtMaskSaysBinary to recognize this format.)

E

Stops a calculation if the search condition is false. The Move_It rule may return a null output buffer if:

- no record was found; a record was found, but the search mask contained a pairing (offset,data) which extended past the end of the record

- a record was found, but the mapped data was blank.

F

Adds a dollar sign ($) and places it in the first position. If the value is negative, it moves the minus sign (-) to the last position.

L

Left justifies the number.

-L (or --)

Tells the system to use a floating negative sign on negative values.

+L (or++)

Tells the system to use a floating sign and to always show that sign.

Lang

Selects a language for spelling out the number. This flag is used with the V flag and mask parameters. Here is an example: US, CFR.

M

Money (This format is a combination of formats C and $.)

N

Leaves the output buffer blank if the number is zero or negative.

NM

Adds a minus sign (-) to the number.

P

Print leading zeros. You cannot use this format with $, -, C, and F.

P**

Prints leading zeros if used without character or symbol enclosed with single quote.

SLZ

Suppresses leading zeros. For example, 00.25 becomes .25.

T

Used with the NegText, Text, and ZeroText data options. Adds text before or after a number. Use the less than (<) symbol for inserting before, the greater than (>) symbol for inserting after. Use the comma as a separator. You can also use this option to place currency symbols before or after amounts. For instance, T>£ places the British pound sterling symbol (Alt+0163) before an amount.

V

Spells out the numeric value in US English.

X

Adds an x before the number.

Z

Prints a number even if it is zero.

Z2

Prints two zeros.

See also