SuiteScript
NetSuite 2026.1
2026-02-23

N/query Pivot API: Native Pivot Tables in SuiteScript 2.1

N/query gains a Pivot module that materializes Workbook-style pivot results inside scheduled and map/reduce scripts — no more reshaping flat result sets in JavaScript.

Affects:SuiteScript 2.1N/querySuiteAnalytics Workbook

The big SuiteScript story in 2026.1 is the new N/query pivot surface. Up to now, anything that needed pivoted shape — totals by class by period, hours by employee by week — required either an ODBC pull or hand-rolling pivots in JavaScript on top of a flat query result set. Both approaches are slow, fragile, and burn governance fast on large datasets.

What actually changed

The 2026.1 build adds a pivot entry point to N/query that accepts the same pivot definitions SuiteAnalytics Workbook uses internally. The result is a typed structure with row groups, column groups, and measure cells — not a flattened array your script has to reassemble.

Why this matters for developers

  • Governance: a pivot pulled server-side counts as a single query call instead of N+1 row reads.
  • Map/Reduce: the pivot result is JSON-serializable so you can hand it off cleanly between getInputData and map stages.
  • Replaces saved-search hacks: the common "summary search + scripted re-aggregation" pattern can be retired for new code.

What to update

If you maintain scheduled scripts that run aggregations on transactionLine or employeeWorkCalendar, plan a refactor pass against this API in your next sandbox refresh. Existing N/search summary searches still work — Oracle has not announced a deprecation — but the pivot API is the path forward for any new analytical workload.