HotXLS Docs

Native Pivot output, cross-filter queries and missing members

Supported manual-parent calculated items retain source and ancestor-group identities through ordinary SUM materialization, formula edits and save/reopen; the column-only header correction also applies to qualified ordinary measures

Quoted local Pivot source names

TXLSXWorksheet.AddPivotTable accepts quoted local worksheet prefixes with spaces, escaped apostrophes, exclamation marks and Unicode, followed by the ordinary supported A1 range, including absolute coordinates

For example, 'Owner''s Data'!$A$1:$B$3 resolves the existing worksheet named Owner's Data; source identity survives cache refresh, ordinary saving and reopening

An empty quoted name, malformed quote escape, missing worksheet or invalid range refuses without creating a cache or view; existing unquoted and current-sheet ranges keep their previous behavior

Native cached worksheet output

function TXLSXWorkbook.MaterializeNativePivotTable(
  ATable: TXLSPivotTable): Integer;
function TXLSXWorkbook.MaterializeNativePivotTable(
  ATable: TXLSPivotTable; AAdoptExisting: Boolean): Integer;

The operation stages both the complete native compact, tabular or outline report grid and its location, rowItems, colItems and data-axis metadata before committing worksheet values and output ownership together; it returns 1 on success or -1 with a diagnostic on unsupported state or a collision

Supported nonempty local views retain current filters, exact cache-member identities, ordinary hierarchies, supported grouped domains, default or custom subtotals and either supported data axis; the native grid uses original aggregate values rather than recombining displayed averages or other nonadditive results

Existing cell objects and formatting remain available, while shrinking or moving the report clears only unchanged previously owned values; edited output, source overlap, merges, formulas, arrays and other reports reject before mutation

Imported scalar output requires explicit adoption with AAdoptExisting=True; subsequent updates use persisted individual-cell ownership, including after saving and reopening

The operation reads current cache records and does not refresh source data or recalculate formulas; Cache.RefreshOnLoad=False is valid because the worksheet now contains actual staged native results

Caller record-filter callbacks participate in the detached preview but have no OOXML representation; Excel's explicit native refresh cannot reproduce arbitrary callback restrictions, while supported persisted manual and Slicer filters retain their wire representation

Supported SUM calculated cache fields and cache-owned SUM, qualified MAX/MIN or finite ordinary COUNT/COUNTNUMS/PRODUCT calculated items use the aggregation contracts described in Native calculated Pivot fields and cache-owned items; custom member captions and unsupported layout combinations reject explicitly, while supported generated raw layout retains unrelated XML and current member masks

TryXLSXMakeNativePivotLayout(const Xml: WideString; Table: TXLSPivotTable; AWriter: TlxPivotResultWriter; out ResultXml, Reason: WideString): Boolean is the lower-level staged layout helper in lxPivotXml

Its final optional ACompactColumnHeaders: Boolean = False parameter selects compact physical headers only for the represented OpenDocument column-layout profile; depth comes from freshly generated real member tuples, independently of the declared location. The workbook-level MaterializeOdsPivotTable route selects this policy for a coherent prior compact owner after proving current source/cache values and retaining complete old-cell overwrite checks

Its writer receives the entire report rectangle in row-major order, including blank cells, with zero-based offsets from the table anchor; XML and grid preflight finish before the first callback, but caller-owned writes cannot be rolled back if a callback raises

The workbook facade supplies a detached capture writer for transactional cell updates; the combined staged preview and native Variant grids are bounded to 4194304 cells

The native preview path can request native grand-total orientation through TXLSPivotTable.MakePreview's optional AUseNativeGrandTotals parameter; existing single-writer and layout-writer calls preserve their previous behavior

Explicit Excel and OpenDocument result consumers

function TXLSXWorkbook.MaterializeOdsPivotTable(
  ATable: TXLSPivotTable; AAdoptExisting: Boolean = False): Integer;

Version 2.384.450 adds an explicit OpenDocument result consumer for the qualified ordinary DATA-sorted multiple-measure profile; the existing MaterializeNativePivotTable entry keeps its Excel behavior

Both entries use the existing detached preparation, source and grid checks, collision checks, resource limits and transaction; the selected consumer is published together with the generated cells and persisted result ownership

For the observed ordinary string-name tie profile, Excel descending numeric sorting reverses the secondary name order, while LibreOffice keeps the secondary name order ascending in both directions; this does not establish every locale's collation or every native Pivot layout

An OpenDocument-owned result must be regenerated through MaterializeNativePivotTable before Excel-family Pivot output; file and stream output and conversion reporting enforce the same boundary, including macro-enabled and template variants

Use MaterializeOdsPivotTable when changing an Excel-prepared result to the qualified DATA-sorted ODS profile; changing the output format alone does not regenerate consumer-specific values or establish equivalent ownership

The previous result owner authorizes replacement only while its owned cells remain unchanged; it does not prove equivalence to another consumer, and edited results or failed preparation retain their prior cells and ownership

Legacy result ownership remains Excel-specific; OpenDocument ownership uses a versioned representation with an explicit consumer, and missing, foreign or unknown consumer metadata cannot grant replacement or export permission

Qualified source-free ODS reopening reconstructs the represented DATA sort and measure identity without provider I/O or automatic source refresh; whole-worksheet copying retains the consumer with its cells, while the existing standalone owned-Pivot-copy refusal remains separate

The lower-level preview and native-layout helpers accept an explicit TXLSPivotNativeConsumer target, defaulting to xlpncExcel; xlpncOpenDocument selects the represented OpenDocument ordering policy and does not broaden ODS conversion admission

Layout and repeated labels

Set Compact and Outline on the report and each row field before materialization; tabular fields use both flags as False, outline fields use Compact=False and Outline=True, and compact fields use both flags as True

property TXLSPivotField.RepeatLabels: Boolean;

RepeatLabels defaults to False, copies independently with the field, and reads or writes the native x14:pivotField fillDownLabels extension; it repeats ancestor labels in tabular and outline output and has no effect on a field whose compact and outline flags are both enabled

Each separate row field receives its own physical column, while adjacent compact outline fields share a label column; multiple measures on rows follow CompactData, and multiple measures on columns retain independent data captions and grand totals

Default tabular subtotals appear below their group; outline SubtotalTop selects the top or bottom location, while measures on rows use separate aggregate rows below the group and retain each measure's caption

Native cached output leaves absent row and column intersections blank and preserves an actual numeric zero; ordinary Make and previews without the native option retain their previous empty-result behavior

Inactive and measure fields inherit the report layout in staged native metadata so Excel's explicit refresh retains the appropriate field and data captions; the operation preserves the live field settings and existing ownership checks

Imported repeated-label extensions accept namespace aliases, including declarations on the extension element itself; unknown unrelated XML remains preserved by the native materialization path

Grouped members, axis order and custom subtotals

Native output supports complete numeric range groups, date groups and manual member groups represented by the cache's existing typed grouping metadata; generated labels retain the exact imported GroupItemLabels, including Unicode and localized date captions

Grouping is evaluated on a detached cache, preserving the live cache's records, shared-item handles and group identities; invalid bounds, zero intervals, incomplete domains or unsupported group-item value types reject before worksheet output changes

The existing zero-based TXLSPivotField.Position determines the stable native row or column axis order; equal positions retain authored field order, so newly created fields with the default position retain their previous ordering

Native imported Year/Month and parent/manual-member hierarchies retain their explicit axis sequence, while cache-field indices, view-field indices and display calculation base identities remain unchanged; manual groups honor explicit Pivot item order rather than sorting group labels or cache indices

Custom row subtotals support xlpsSum, xlpsCount, xlpsAverage, xlpsMax, xlpsMin, xlpsProduct, xlpsCountNums, xlpsStdDev, xlpsStdDevP, xlpsVar and xlpsVarP, including multiple selected functions, tabular or outline fields and measures on rows

Each function aggregates the original source records at its own subtotal scope; its staged row metadata identifies the selected function independently, preserving Excel's explicit refresh behavior for nonadditive calculations and empty or error results

An imported custom subtotal selection excludes the implicit automatic subtotal even when defaultSubtotal is absent in native XML; applications must not combine xlpsDefault with custom functions, and such an ambiguous typed request rejects before mutation

Unsupported compact data-axis combinations, collapsed members and custom captions remain outside this native output contract; calculated fields and items have their own narrower SUM and member-identity requirements, and raw preservation does not imply support for recalculating or materializing a feature

Saving, reopening and rematerializing retain supported grouping, axis order and subtotal identities; imported native views and independently copied typed caches have also been verified against Excel on both initial open and explicit refresh

Multilevel column subtotals and measure captions

Native local materialization supports default and custom subtotals across multiple column-field levels, including supported layouts with multiple measures on columns or rows; each subtotal aggregates the original source records at its own scope

Set a column field's Subtotals to [xlpsDefault] for automatic subtotals or to the supported explicit functions described above; multiple explicit functions can be selected together, while combining xlpsDefault with explicit functions remains an ambiguous request that rejects before mutation

With multiple measures on columns, subtotal captions identify the corresponding measure; explicit-function subtotal captions also identify the aggregation, while ordinary data captions and grand totals retain their measure identity

At the intersection of a row subtotal and a column subtotal, two different explicit functions leave the result blank; for example, an explicit row SUM crossed with an explicit column AVERAGE does not arbitrarily choose one calculation, while a default subtotal crossed with an explicit function uses that explicit function

Sparse reports reserve enough output columns for the complete field-caption header and any measure-caption column even when there are fewer result columns than header fields; worksheet bounds and the full report rectangle are checked before output begins

Subtotal rows or columns render only for fields with an inner level to summarize: the innermost row or column field emits none even when its defaultSubtotal flag stays set, matching Excel on single-field and multilevel axes; MIN and MAX measures over complete numeric-range and date groups verify natively at bucket, subtotal and grand-total scopes

Collapsed members materialize natively: a row or column item with hidden details renders as one aggregate row carrying its plain label, replaces its whole descendant subtree and applies under every parent, while enclosing blocks keep their subtotals and the collapsed level itself never repeats a separate subtotal row; the sd flag round-trips through save and native refresh

Collapse composes with manual member groups and outline layouts: a discretePr parent item collapses through its group-ordinal identity, and outline fields with subtotals on top render the default subtotal as the caption row itself, so a collapsed group appears as one plain-labeled row in every qualified layout

Column-axis collapse spans a collapsed member across its descendants in one range, and compact shared-label rendering stacks the single-measure caption above the field captions with the implicit data column headed by its plain Total caption

Members order natively by a chosen measure: sortType with the measure resolved from the autoSortScope data-axis reference (or rankBy) sorts rows or columns by that measure ascending or descending, with invalid metrics grouped last, deterministic label tie-breaking and blank members demoted; exact tie permutations under equal metrics follow Excel's unstable sort and are not reproduced

Collapsed outer column members compose with multilevel column subtotals: the collapsed member spans its descendants in one range beside the expanded groups' month columns, subtotal columns and the grand-total column; the stacked measure caption applies only to the no-column-field compact profile where native reserves the corner cell

The supported native metadata and cached report cells retain the column hierarchy, subtotal functions and measure captions through save/reopen and explicit Excel refresh; the existing restrictions on collapsed members, custom member captions and unsupported layout combinations still apply

Modern native count-ranking filters

Represented native count filters expose FilterType=xlpfTopCount or xlpfBottomCount, a positive integer Value1 and an identified ordinary measure through DataField; set DataFieldIsMeasureIndex=True when the index identifies the zero-based measure position

MaterializeNativePivotTable selects the top or bottom members using that measure, including every member tied at the cutoff; ordinary other measure columns and totals follow the filtered population

A count greater than the member domain retains all eligible members; zero, fractional limits, unresolved measure identities, unqualified aggregation modes and unsupported source populations refuse explicitly

Fresh filters and represented same-owner, same-measure imported count edits are qualified; call MaterializeNativePivotTable after changing Value1 before saving the updated report and criteria

Filter replacement, unrelated advanced metadata edits, grouped or calculated count-ranking execution stay outside this profile; the four cumulative ranking modes have their separate selected-metric and SUM contracts below; direct criteria-only saving of an imported count edit keeps the existing advanced-filter guard

For retained standard percentage or sum-ranking top10 profiles that remain untyped, MaterializeNativePivotTable explicitly rejects before changing report cells; ordinary SaveAs and reopening retain the original Pivot definition

This is not a generic unknown-filter rule or a promise that other preview/materialization entry points reject the same profiles

Modern native count filters are distinct from legacy AutoShow: Excel authors and refreshes the qualified ordinary TopCount profile, while the retained legacy AutoShow and grouped native ignored-filter observations remain separate boundaries

Separate native controls qualify manual grouped row and column sorting with two measures whose orderings disagree, proving ownership by the selected second measure; this is not arbitrary multi-key sorting qualification

Selected COUNT and AVERAGE count ranking

Ordinary xlpfTopCount and xlpfBottomCount also rank an identified COUNT or AVERAGE measure; the selected measure position is independent of its source-field identity, including multiple measures over the same field

COUNT ranks nonempty selected measure values, including nonempty text and Boolean values, while skipping missing values; it does not rank category population or apply numeric-only COUNTNUMS semantics

AVERAGE ranks the mean of original numeric records and ignores text, Boolean and missing values; it does not average already aggregated member totals

For A=[20,30,50], B=[50,70], C=[90] and D=[2,4,6,8], TopCount 2 selects A and D by COUNT, B and C by AVERAGE, and A and B by SUM; BottomCount 2 selects B and C by COUNT and A and D by AVERAGE

The existing positive integer limits and cutoff-tie inclusion apply through source changes, same-owner target edits, public authoring, repeated execution and save/reopen; other measure columns and grand totals follow the filtered population

Actual native comparisons qualify a source with four real fields and separate SUM, COUNT, AVERAGE and COUNTNUMS measures; an earlier two-field/four-measure saved-native AVERAGE shape failed normal reopening even before library processing and remains outside the qualified compatibility profile

Ambiguous source-field identities, grouped/calculated contexts, source errors, empty strings and members without the required metric explicitly refuse in this COUNT/AVERAGE profile; AVERAGE additionally refuses date-valued sources and nonfinite inputs or intermediate means

COUNT recognizes finite nonempty date values through the existing type classification, but ranked-date native compatibility is not qualified by this increment; the four cumulative sum/percentage modes follow the separate selected-metric contract below

Ordinary numeric ranking aggregations

Ordinary xlpfTopCount and xlpfBottomCount also support selected COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP measures over finite numeric source values

Each member's metric is finalized from its original numeric records before applying the existing positive integer limit and cutoff-tie inclusion; the selected measure remains independent of other aggregations over the same source field

Sample deviation and variance use the record count minus one; population forms use the record count; report grand totals recompute the selected aggregation across original records of retained members rather than summing their displayed aggregate values

For A=[11,13,7,9,10], B=[5,13,3,15], C=[14,12,13], D=[11,9,9] and E=[12,2,3,9,8], TopCount 2 selects A+C by SUM or AVERAGE, A+E by COUNTNUMS or PRODUCT, B+C by MAX, C+D by MIN, and B+E by either sample/population deviation or variance

The qualified two-field source has the selected aggregation at measure ordinal zero and a separate SUM control at ordinal one; genuine imported execution, count-limit edits, source edits and fresh public top/bottom rules retain their identities through save/reopen and actual native refresh

This added COUNTNUMS profile accepts numeric sources only; mixed-value skipping is not qualified here, and the preceding nonempty COUNT and numeric AVERAGE profiles retain their own type semantics

Sample STDEV and VAR require at least two numeric records per eligible member; population STDEVP and VARP require one and retain the existing singleton result of zero, while this increment's independent native positive members all contain at least three records

Nonnumeric sources, insufficient samples, nonfinite selected results, invalid statistical state, unresolved or ambiguous measure identities and unsupported grouped/calculated contexts refuse before report publication; an unrelated unused PRODUCT overflow does not reject a finite selected MAX result

Replacing an imported retained TopCount predicate with BottomCount remains an unsupported owner edit; create a fresh BottomCount rule for the qualified public authoring path

The four cumulative sum/percentage predicates follow the selected-metric contract below; selected non-SUM value comparisons follow the qualified contract below, while other calculated-context combinations remain separate

Native calculated-field count ranking

xlpfTopCount and xlpfBottomCount can select an explicitly identified cache-owned native calculated field used as a SUM measure with normal display, one ordinary row field, no column field and no grouped or calculated-item plan

The existing native expression plan finalizes each eligible member metric once; bounded count selection retains all members tied at the cutoff, then existing measure accumulation recomputes displayed values and totals from retained original dependencies

For the qualified Ratio=Sales/Units source, TopCount 2 selects C+D with grand Ratio 110/3, while BottomCount 2 selects A+B with grand Ratio 170/110; source denominator edits change the selected members independently of the raw Sales SUM order

The count limit must be finite, positive, integral and at most High(Integer); every selected metric must be finite and numeric, and missing or ambiguous measure identities explicitly refuse

Known imported count predicates retain their limit-only edit contract; calculated count owners validate retained structure even when the limit is unchanged, while unknown attributes, duplicate or foreign owners refuse before any report writer callback

Selection vectors, ordering, old/new allocation overlap, the bounded heap and formula temporary storage are charged before use; selection work joins the existing sixteen-million work forecast and the added storage respects the 512 MiB hard bound

Ten actual native outputs qualify both directions, one/all limits, denominator edits and cutoff ties; four library-only repeats are separate, and rejected definitions retain their original raw bytes through ordinary saving

This does not move table-level AddCalculatedMember postprocessing earlier or add a formula engine; grouped, calculated-item, multi-axis and transformed-display ranking remain outside this finite profile, and calculated cumulative modes remain unsupported

Selected ordinary value comparisons

Ordinary native xlpfValueEquals, xlpfValueNotEquals, xlpfValueGreaterThan, xlpfValueGreaterThanOrEqual, xlpfValueLessThan, xlpfValueLessThanOrEqual, xlpfValueBetween and xlpfValueNotBetween compare the actual selected measure

Set an explicit resolvable DataField identity, using DataFieldIsMeasureIndex=True for a zero-based data-measure ordinal; absent or ambiguous identities refuse rather than implicitly selecting the first measure

COUNT uses nonempty selected source values, AVERAGE uses original numeric records and the other standard numeric kinds use their finalized aggregate; the preceding type, finite-result and sample-population boundaries remain in force

For the source population in the ordinary aggregation example above, AVERAGE greater than 9.8 retains A+C and COUNT greater than 4 retains A+E; comparing raw SUM instead incorrectly retains all five members

Value1 must be a finite numeric threshold; between/not-between also require finite Value2 with Value1 <= Value2, retaining the existing inclusive interval and comparison tolerance semantics

All eight AVERAGE comparators have actual native opened/refreshed output evidence; COUNT and COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP have finite greater-than representatives, without an exhaustive operator-by-aggregation claim

Fresh public rules, repeated execution, source changes and save/reopen retain the qualified result; source changes preserve the imported predicate bytes, while changing an imported threshold, operator, selected measure or other owned metadata remains unsupported in this increment

The retained filter owner must have the unique same-namespace known condition structure; unknown attributes, foreign or duplicate owners, invalid operands, unsupported non-SUM grouped contexts, missing metrics or exhausted work/memory limits refuse before publishing a partial report

Unchanged unsupported definitions still save through their raw-preservation path; this does not establish execution support

Legacy synthetic count comparisons use category population, synthetic percent comparisons use population percentages and synthetic sum comparisons use sums; the four cumulative ranking modes have their separate selected-metric contract, and late calculated-member value filters retain their existing finalized-metric contract

Qualified layout and filter categories

Represented multilevel column subtotals, collapsed-member compositions and custom captions have positive execution and native lifecycle evidence; the ordinary selected-measure ranking profiles cover count and cumulative modes, eleven aggregation classes, selected value comparisons and finite native calculated-field count ranking

These are the bounded layout/filter categories described in this reference; source eligibility, sample minimums, split ties, imported owner edits and each grouped or calculated context keep their stated limits, with raw preservation and rejected execution assessed separately

Selected ordinary cumulative metrics

xlpfTopSum, xlpfTopPercent, xlpfBottomSum and xlpfBottomPercent identify an explicitly selected ordinary measure through DataField and DataFieldIsMeasureIndex; COUNT, AVG, COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP reuse the existing member accumulator/finalizer paths

Selection orders finalized member metrics and accumulates them to the target; percentages use the sum of eligible member metrics as their denominator, while displayed values and grand totals retain standard aggregation over the original retained records

For the qualified AVG TopPercent source, the selected member means are 90 and 60, while the grand AVG is 210/3=70; for PRODUCT, selected member products 90090 and 5184 produce a report grand PRODUCT of 467026560

The new non-SUM profile requires one ordinary ungrouped row axis, normal display, finite nonnegative eligible member metrics and a positive finite sum of those metrics; calculated and grouped cumulative execution remains outside this profile

COUNT requires a nonempty selected source value per eligible member and AVG requires a numeric selected source value; their existing error, mixed-value, empty-string and unqualified date-AVG restrictions remain, while the other eight classes retain numeric-only sources, sample-size minimums and finite finalizer results

Sum targets remain finite and nonnegative, percentages remain within zero through 100, and a zero target considers at least one member; split equal-metric boundaries, negative or zero-total non-SUM populations, invalid identities and positive scaled-target underflow refuse before publishing a report

Known imported predicates permit owned target-only edits after explicit materialization; selected non-SUM owners validate complete retained structure even when the target is unchanged, and opaque attributes, foreign namespaces or duplicate owner containers refuse while ordinary saving retains their original definitions

Fresh programmatic selected cumulative and native calculated TopCount/BottomCount rules support immediate repeated materialization, SaveAs and another call; the workbook derives unspecified source-order normalization from a unique internal raw binding with no imported source part name, while real imported definitions retain strict source-order validation

Sixteen genuine native profiles cover COUNT/AVG in both directions and eight additional TopSum aggregation representatives; thirty actual output openings and refreshes qualify source edits, target edits and fresh rules, with twenty additional repeats counted separately as library-only

The existing SUM contracts below keep their signed Top, zero-total, source eligibility and split-tie behavior; the new finite non-SUM population rules do not change those SUM semantics

Modern native cumulative SUM ranking

FilterType=xlpfTopSum identifies the represented standard top-sum ranking independently of sum-comparison filters; Value1 is a finite nonnegative cumulative target, and DataField identifies the numeric SUM measure

MaterializeNativePivotTable orders eligible members by descending measure value and keeps a prefix until its cumulative sum reaches the target; other displayed measures and totals follow that population

At least one member is selected before testing the target, so a zero target retains a unique largest member; if the target cannot be reached, every eligible member remains selected, including the qualified mixed-negative and all-zero positive-target profiles

Same-owner target edits, including a fractional 90.5 target, source refresh and fresh public authoring are qualified through calculation, saving, reopening and actual native refresh; materialize after editing the predicate before saving it

A cumulative boundary that would split equal-metric members explicitly refuses because the native selection order has not been qualified; count ranking retains its separate all-ties rule

Negative population totals, empty or nonnumeric measure items, ambiguous measures, grouped and calculated contexts also refuse; non-SUM measures use the separate finite selected-metric contract above; an all-zero population with target zero falls within the split-boundary refusal

Ordinary saving retains the original report definition when execution refuses; broader signed-population semantics remain outside this contract; TopPercent and nonnegative bottom cumulative predicates follow their separate contracts below

Modern native cumulative percentage ranking

FilterType=xlpfTopPercent is distinct from count ranking and percentage-comparison filters; Value1 is a finite percentage in the inclusive range zero through 100, and DataField identifies the ordinary numeric SUM measure

The cumulative target is the eligible population SUM multiplied by Value1/100; members are considered in descending measure order, rather than selecting a percentage of the item count

Zero percent retains a unique largest member, fractional percentages retain their value, and positive percentages with a zero population total keep every eligible member in the qualified all-zero or mixed-zero-total profiles

A mixed-negative population with a positive total can reach a 100-percent target before including every member; the qualified native case retains a sum of 140 from a population total of 130

Same-owner target edits, source refresh, denominator changes, fresh authoring and save/reopen are qualified with actual native opening and refresh of representative outputs

Split equal-metric boundaries, negative population totals, empty or nonnumeric measures, grouped or calculated contexts and invalid measure identities explicitly refuse; a positive percentage scaling a positive total to a zero target also refuses rather than inventing an underflow rule

Ordinary saving retains the original report definition on execution refusal; general native tie ordering and unrepresented extreme floating-point behavior remain separate boundaries; BottomSum and BottomPercent follow the nonnegative contract below

Modern native bottom cumulative ranking

xlpfBottomSum and xlpfBottomPercent identify independent predicates whose selected DataField is an ordinary numeric SUM measure; eligible source values must be finite and nonnegative

Members are considered from smallest to largest SUM until the cumulative target is reached; Value1 is a nonnegative sum target or a percentage in the inclusive range zero through 100, including fractional values

For member sums 80, 10, 60 and 20, BottomSum 25 retains the members with 10 and 20, while BottomPercent 50 retains those with 10, 20 and 60

A zero target considers at least one member; an unattainable positive target retains all eligible members, and a positive percentage on a zero-total population also retains all eligible members

Represented same-owner target edits, source refresh, fresh public authoring and repeated materialization of the same workbook are qualified through save/reopen and actual native opening and refresh of representative outputs

Split equal-metric thresholds, negative or empty source measures, grouped or calculated contexts, nonfinite results and positive scaled-target underflow explicitly refuse before publishing output; ordinary saving retains the original report definition

Editable predicate identity is validated even when its numeric target is unchanged; fresh source-order normalization retains the existing behavior

Native display calculations

Set each ordinary data field's ShowDataAs or ExtendedShowDataAs before calling MaterializeNativePivotTable; basic and extended display modes are mutually exclusive

Basic modes include difference, percent of a base item, percent difference, running total, percent of row, column or grand total and index; extended modes include parent row, parent column and selected parent percentages, cumulative percentage and ascending or descending dense ranks

BaseField is the zero-based Pivot field index for comparisons, running totals, selected parent percentages and ranks; comparisons use the zero-based BaseItem position, or xlPivotBaseItemPrevious and xlPivotBaseItemNext for adjacent visible members in the effective display order

Parent row and parent column percentages choose the corresponding innermost axis field without using BaseField; a missing corresponding axis leaves those results blank

Simple percentages divide by the original aggregate at the relevant scope, including nonadditive averages; cumulative percentages sum displayed member aggregates and use the original axis total for an innermost base field, while an outer base field uses the sum across its matching remaining members, so averages can exceed 100 percent

Native ranks count distinct preceding aggregate values, and comparisons preserve Excel's blank and error behavior for absent intersections, missing bases, zero divisors and previous or next boundaries; simple percentages treat an absent numerator as zero

Grand totals use the selected mode's native semantics, including blank totals along a comparison or running axis; changing a display mode retains the report's transactional ownership, collision and budget checks

Saving and reopening retains the chosen basic or extended mode and base identities, and staged native metadata supports an explicit Excel refresh; ordinary Make and previews without the native option retain their existing calculation contract

Slicer cross-filter availability

property TXLSXSlicerCache.ItemHasData[Index: Integer]: Boolean;

This read-only query evaluates current supported non-OLAP cache records while ignoring this Slicer's own selection and retaining other Slicer selections, manual filters, caller predicates and applicable aggregate filters

Availability is the union across connected views; historical members without matching records have no data, blank measures have no data, and nonempty text, Boolean, zero, error and date measures count as data under the verified native contract

The query uses a read lease and detached record preview, preserves live handles and selection, and honors FormulaArrayMemoryLimit; callback failure, reentry, invalid bindings or unsupported aggregate calculated members raise without committing live changes

Querying availability does not refresh caches, recalculate formulas, perform file I/O or update serialized native no-data flags; applications should not infer native UI state from this read-only operation

TlxPivotRecordWriter = procedure(ATable: TXLSPivotTable;
  ARecordIndex: Integer) of object;
function TXLSPivotTable.MakeRecordPreview(AWriter: TlxPivotRecordWriter;
  AFilterOwner: TObject = nil; AFilter: TlxPivotRecordFilter = nil): Integer;

The advanced record callback receives the detached preview and a zero-based record index after supported simple and aggregate filtering; EvaluationSourceTable retains the original view identity and the return value is the number of emitted records

A replacement filter substitutes only the supplied owner's registered callback; other owners and the external predicate remain active, and a non-nil replacement callback requires a non-nil owner

Explicit historical-member purge

Removed := Workbook.PurgePivotCacheMissingItems(
  Pivot.CacheId, 0);
if Removed < 0 then
  raise Exception.Create('The cache member purge was rejected');

TXLSXWorkbook.PurgePivotCacheMissingItems(ACacheId: Integer; ARetainMissingItemsPerField: Integer = 0): Integer removes unused members after complete validation and remapping of supported linked views and Slicers

It returns the total removed shared-item count across all fields, zero for a successful no-op, or -1 with diagnostic 1402; current records retain every referenced member, plus at most the requested number of unused members per field chosen by greatest original shared-item index

Retained members keep their original relative order and object handles while logical indices become compact; linked field/item handles, manual hidden and detail flags, active page or comparison members and Slicer selections retain their identities

Domain flags and bounds are recomputed from the retained domain; supported imported compressed row/column and page positions are remapped explicitly, while grand-total dummy references and data pseudo-field ordinals remain unchanged

Ordinary complete local worksheet caches are supported; grouped, calculated, member-property, OLAP, external, incomplete or ambiguous caches and unsupported opaque identity metadata reject before mutation

Removing an active page or comparison member, an entire selected Slicer subset or a previously nonempty effective intersection rejects atomically; primitive member attributes that would be lost during typed rebuilding also reject

The known materialization ownership extension remains unchanged because its coordinates and typed value tokens contain no cache-member indices; unrelated opaque extensions are not assumed safe

Purge does not refresh source data, rewrite worksheet report cells, invoke record callbacks or apply MissingItemsLimit metadata automatically; refresh remains append-only unless this operation is explicitly requested

Advanced purge coordination

TXLSPivotCache._PrepareMissingItemPurge returns an opaque TXLSPivotCachePurgePlan; applications should normally use the workbook facade so every linked view and Slicer is included

MapItem and RemainingItemCount inspect cache remapping, StagePivotField registers a linked field and returns its stage index, and MapViewItemPosition inspects that field's wire position mapping; removed members map to -1 and RemovedCount reports the total removal count

Validate checks original schema, records, field/item ownership identities and staged view selections; Commit validates again and transfers prepared ownership without allocation or callbacks after the first live exchange

The plan owns detached snapshots, keeps its mutable staged cache private, and never owns original cache or view objects; keep those originals alive until the plan's Destroy releases staging, and commit each plan only once

Rejected field staging rolls back that stage so the plan can be reused; unsupported mutations after preparation reject before commit