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 matter how many times segment 139 repeats, segment 40 element 2 will contain the total sum of each repetition of segment 139 element 2.