Commit Graph
1 Commits
Author SHA1 Message Date
waozi 5d92982b02 Add database functions with 1:1 gnumeric parity
Port gnumeric's fn-database semantics: criteria parsing with
comparators (>, >=, <, <=, <>, =, wildcards * and ~-escapes),
case-insensitive value matching, OR-across-criteria-rows /
AND-within-row evaluation, and field lookup by header name or
1-based index. DAVERAGE DCOUNT DCOUNTA DGET DMAX DMIN DPRODUCT
DSTDEV DSTDEVP DSUM DVAR DVARP GETPIVOTDATA.

- DCOUNT/DCOUNTA accept an omitted field (counts rows via the first
  column, gnumeric's flags=0 behavior)
- DGET returns the first match including strings
- GETPIVOTDATA mirrors the rs signature: last-row cell of the named
  column, #VALUE! when the first argument is not a range

Also fix .gnumeric loading so a ValueType=60 string starting with '='
stays text instead of being treated as a formula (gnumeric only
parses untyped '='-content as expressions).

tests/fixtures/database_functions.gnumeric: 26 formulas, all matching
ssconvert output; parity-test.sh green for 9 fixtures and round-trips.
2026-09-05 03:58:20 -03:00