Setting Summary Elements
Summary elements contains the sum of other element values. Summary elements are used for balance fields.
Summary elements should be added when you have completed creating an EDI rules file.
You cannot use the EDI Rules Creator to add summary elements rules. To add rules you must explicitly open a EDI rules file with notepad or other text editor an go to the SUMMARY section.
The section contains the summary elements. Summary elements are elements whose values contain the sum of other element’s values
Here we see that a segment with ordinal number 40, element 2 must contain the sum of segment 139 element 2 values. It does not matter how many times segment 139 repeats, segment 40 element 2 will contain the total sum of each repetition of segment 139 element 2.
Summaries can also be used to sum up data in a segment. In the example below the sum of element 40:2 and 40:3 must add up to the value in 40:1
As of RDPCrystal EDI Library 8.1 the summary values can also be used to count the number of repetitions of a segment rather than just a total sum of an element’s value. For example:
This means that a segment with ordinal number of 40, element 2 must contain the number of repetitions of the a segment with ordinal 135. This is used when the need to count how many loops exist where is total number is displayed in an element of a higher loop, in this case segment 40 element 2.