{"record":{"id":"55f655c605f9cc01","repo":"iOfficeAI/OfficeCLI","slug":"showdataas-showas-is-not-yet-supported-by-the","errorCode":null,"errorMessage":"showDataAs '{showAs}' is not yet supported by the renderer (would silently return raw aggregate). Supported: normal, percent_of_total, percent_of_row, percent_of_col, running_total.","messagePattern":"showDataAs '(.+?)' is not yet supported by the renderer \\(would silently return raw aggregate\\)\\. Supported: normal, percent_of_total, percent_of_row, percent_of_col, running_total\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/PivotTableHelper.Parse.cs","lineNumber":458,"sourceCode":"    }\n\n    private static ShowDataAsValues? ParseShowDataAs(string showAs)\n    {\n        return showAs.ToLowerInvariant() switch\n        {\n            \"\" or \"normal\" => null,\n            \"percent_of_total\" or \"percentoftotal\" or \"percent\" => ShowDataAsValues.PercentOfTotal,\n            \"percent_of_row\" or \"percentofrow\" => ShowDataAsValues.PercentOfRaw,\n            \"percent_of_col\" or \"percent_of_column\" or \"percentofcol\" or \"percentofcolumn\" => ShowDataAsValues.PercentOfColumn,\n            \"running_total\" or \"runningtotal\" or \"runtotal\" => ShowDataAsValues.RunTotal,\n            // CONSISTENCY(strict-enums): difference / percent_diff / index are\n            // accepted by the OOXML ShowDataAsValues enum, but ApplyShowDataAs1x1\n            // has no matrix transformation for them, so rendered cells would\n            // silently equal the raw aggregate. Reject up front until a proper\n            // renderer exists, mirroring the invalid-sort / invalid-aggregate\n            // policy from Round 1.\n            \"difference\" or \"diff\" or \"percent_diff\" or \"percentdiff\" or \"index\" =>\n                throw new ArgumentException(\n                    $\"showDataAs '{showAs}' is not yet supported by the renderer \" +\n                    \"(would silently return raw aggregate). Supported: normal, \" +\n                    \"percent_of_total, percent_of_row, percent_of_col, running_total.\"),\n            // CONSISTENCY(strict-enums): unknown showAs tokens are rejected\n            // up front so users see typos at Add/Set time, not on render.\n            _ => throw new ArgumentException(\n                $\"invalid showDataAs: '{showAs}'. Valid: normal, percent_of_total, percent_of_row, \" +\n                \"percent_of_col, running_total\"),\n        };\n    }\n\n    // R11-2: Right-to-left value-spec parser support. Token recognizers\n    // mirror the cases ParseSubtotal / ParseShowDataAs accept (lowercase\n    // canonical only — we lowercase the token before calling). Keep these\n    // in sync if new aggregates / showAs tokens are added downstream.\n    private static bool IsKnownAggregateToken(string token) => token switch\n    {\n        \"sum\" or \"count\" or \"countnums\" or \"countnum\" or \"average\" or \"avg\" or","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/PivotTableHelper.Parse.cs#L440-L476","documentation":"ParseShowDataAs accepts difference / diff / percent_diff / percentdiff / index tokens but immediately throws, because while the OOXML ShowDataAsValues enum defines them, the in-process renderer (ApplyShowDataAs1x1) has no matrix transformation for them — accepting them would silently render the raw aggregate and mislead the user. The message names the supported set so the user can pick a working alternative.","triggerScenarios":"values=Sales:sum:difference; values=Sales:sum:percent_diff; values=Sales:sum:index; copying a showDataAs token from an Excel-generated file that uses one of these unsupported modes.","commonSituations":"User wants period-over-period or indexed calculations and reaches for the OOXML token without realising the renderer only supports percent/running-total family; replaying a spec exported from native Excel that exercises these modes.","solutions":["Use a supported showAs: normal, percent_of_total, percent_of_row, percent_of_col, or running_total","Compute the difference/percent_diff transform upstream and feed the resulting values as a regular sum field","Track the feature request — these tokens are deliberately gated until a proper renderer exists"],"exampleFix":"// before\nvalues=\"Sales:sum:percent_diff\"\n// after (compute upstream, or pick a supported showAs)\nvalues=\"Sales:sum:percent_of_total\"","handlingStrategy":"validation","validationCode":"var unsupported = new[] { \"difference\", \"diff\", \"percent_diff\", \"percentdiff\", \"index\" };\nif (unsupported.Contains(showAs.ToLowerInvariant()))\n    throw new InvalidOperationException($\"showDataAs '{showAs}' has no renderer; precompute the transform instead\");","typeGuard":"static readonly HashSet<string> SupportedShowAs = new(StringComparer.OrdinalIgnoreCase)\n{ \"normal\", \"percent_of_total\", \"percent_of_row\", \"percent_of_col\", \"running_total\" };\nstatic bool IsSupportedShowAs(string s) => SupportedShowAs.Contains(s);","tryCatchPattern":"try { BuildPivot(props); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"not yet supported by the renderer\"))\n{ /* switch to a supported showAs or precompute upstream */ }","preventionTips":["Use only the supported showAs family","Compute difference/percent_diff/index transforms upstream and feed plain sums","Track the renderer roadmap before relying on these tokens"],"tags":["pivottable","showdataas","strict-enum","renderer-limitation","argument-validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}