Sum Aggregate Per Numeric Column
Sum explicit CSV numeric columns with exact decimal arithmetic, ignoring blank cells and rejecting other nonnumeric values; report observation counts and preserve an explicit header interpretation.
Description
Exact decimal sums avoid floating-point rounding of spreadsheet numeric text.
Exact decimal sums avoid floating-point rounding of spreadsheet numeric text. Explicit column selection and header interpretation keep aggregation intentional.1
Sum explicit CSV numeric columns with exact decimal arithmetic, ignoring blank cells and rejecting other nonnumeric values; report observation counts and preserve an explicit header interpretation.
When to use Sum Aggregate Per Numeric Column
Use this for the following task: Sum explicit CSV numeric columns with exact decimal arithmetic, ignoring blank cells and rejecting other nonnumeric values; report observation counts and preserve an explicit header interpretation.
Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
How to use Sum Aggregate Per Numeric Column and understand its results
- Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
- Enter csv, delimiter, hasHeader, columnIndices using the field table, then run the tool.
- Read columns. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| csv | CSV text | string; maximum text length 100000 | Required |
| delimiter | Delimiter | string; choose ",", ";", "\t" | Required |
| hasHeader | Has header | boolean | Required |
| columnIndices | Column indices | list of integer; minimum entries 0; maximum entries 10000; each entry: integer; minimum 0 | Required |
Parse rectangular records and select distinct zero-based columns. Skip trimmed blanks, reject other invalid decimals, add scaled integer decimal values and return each column’s count and exact sum string.2
Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.
sum[column] = Σ parsed nonblank dot-decimal values This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| columns | Columns | list of record: column (integer), count (integer), sum (string) |
{
"input": {
"csv": "item,amount\na,0.1\nb,0.2",
"delimiter": ",",
"hasHeader": true,
"columnIndices": [
1
]
},
"output": {
"columns": [
{
"column": 1,
"count": 2,
"sum": "0.3"
}
]
}
} Limitations and assumptions
Grouping and exponent spellings are not accepted. A selected column with no numeric observations has count 0 and sum 0. Decimal parsing trims outer whitespace, requires digits before the separator and limits a numeric token to 200 characters.
Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose Checksum Total Row Appender for this operation: Append one CSV total row for explicitly selected dot-decimal columns, ignoring blanks and placing a supplied label in a separate column; all totals remain exact strings. For a complementary task, use Mean Aggregate Per Numeric Column for this operation: Compute exact means for explicit dot-decimal CSV columns as reduced numerator/denominator strings, ignoring blanks; count zero and hasValues false identify absent means.
Further background: Format and language reference: Sum Aggregate Per Numeric Column.
References
-
Format and language reference: Sum Aggregate Per Numeric Column — RFC Editor
-
Sum Aggregate Per Numeric Column — tool.io
Similar or alternative tools
- Checksum Total Row Appender
Append one CSV total row for explicitly selected dot-decimal columns, ignoring blanks and placing a supplied label in a separate column; all totals remain exact strings.
- Mean Aggregate Per Numeric Column
Compute exact means for explicit dot-decimal CSV columns as reduced numerator/denominator strings, ignoring blanks; count zero and hasValues false identify absent means.