occurrencetotal

The occurrencetotal function allows an extended rule to check the total occurrences of a particular record thus far in the processing (this is a running total of the number of times the record has occurred at the specific point in time that the occurrencetotal rule is called). This function returns an integer value containing the number of occurrences of the specified record that have been processed.

All modes of operation are exercised by SWIFT MX and FIN maps in the occurrencetotal extended rule. FIN maps reference the traditional usage (%recordname) of the occurrencetotal function while the MX maps reference can also reference the group name ($group).

Note: The group name usage is reserved for the XML syntax only, because of how the blocks are inserted into the map structure during the compilation process to handle the XML start and end tags in an XML document.
Note: To reset OccurrenceTotal to zero so you can determine, for example, if a particular block occurred in the current iteration of a group, use the resetoccurrencetotal function. See resetoccurrencetotal.

Syntax


occurrencetotal(%recordname);
Note: The syntax %recordname indicates a record that is referenced by name.

Example

An example of this function follows:


If occurrencetotal(%myRec) > 2 then
//This specifies that if the myRec record has occurred (been processed) more 
//than
//twice, then the logic that follows this function will be performed by the
//translator.