Open topic with navigation
When summarizing equal-keyed records in a DMExpress aggregate task, totaling a field results in a summarization overflow (SOVFL) error when the total contains more digits than can be accommodated in the format and length of the field.
To avoid an SOVFL error, ensure that each of the summarized fields is set to a format/length that can contain the greatest possible positive/negative values that may result from the summarization.
When a summarized field is not large enough to contain the totaled value, the following error message is generated:
(SOVFL) summarization would cause overflow; multiple equal-keyed records remain.
DMExpress does not complete the final totaling, and it retains more than one set of equal-keyed records.
By default, the length of a totaled value is set to the length of the field or value that is summarized using Total. When totaling an IfThenElse value, the larger of the two fields/values in the Then and Else portions become the length of the IfThenElse value.
To accommodate the maximum possible length of the totaled value, select the value in the Aggregate dialog, select the Change field format before summarizing checkbox, and adjust the format and length as needed.
Attached are two examples (together with source and output data), one that yields the SOVFL error, and one that handles it to produce correct output without the error.
The Sovfl.dxt example task yields the SOVFL error message when totaling the value Code_1or15, which is defined as follows:
IfThenElse(SalesDetails.Code = 1 or SalesDetails.Code = 15,1,0)
Code_1or15 evaluates to 1 or 0 based on the condition defined in the IfThenElse function, which results in a numeric value of length 1 byte. By default, the summarized Total value is set to the same length in the target record layout.
However, the source data contains 10 equal keyed records whose code is 15, so the total value of Code_1or15 would be 10, which does not fit into a 1 byte field. As a result, the SOVFL error is issued and the output contains two records for that equal keyed set, one for the first 9, and a second for the tenth.
In the SovflHandled.dxt example task, the Change field format before summarizing checkbox in the Aggregate dialog is checked for the Code_1or15 Total field, and the Length has been increased to 2 bytes to accommodate the double digit total value.
The target record layout reflects the change in the summarized field format, and the resulting output is as expected:
126_SovflError.zip, compatible with DMExpress version 8.0.5 or higher
For additional information, search SOVFL in the DMExpress Help.
Copyright © 2016 Syncsort All rights reserved.