Repeated keys are not automatically duplicate data
An analyst receives two exported rows with the same report dimensions and deletes one as a duplicate. Another analyst keeps both but averages their CTR and position values. Either choice can change the reported result. Before accepting a bulk-export calculation, specify the table, reporting grain, metric fields and aggregation operation, then replay a small filled example whose correct answer can be checked by hand.
Use the table definition, not a guessed uniqueness rule
Google documents repeated keys in incrementally accumulated bulk-export rows and advises aggregating metrics. Its site table uses sum_top_position; the URL table uses sum_position. Both are zero-based position sums, so their documented average calculation divides the appropriate sum by impressions and adds one. This exercise uses the site table only and never combines the two aggregation scopes.
Work the two-row example
All supplied dimensions in the synthetic packet are identical: property sc-domain:cedar.example, report date 2026-10-20, query inspection guide, country aus, web search and mobile. Row A has 10 impressions, 2 clicks and sum_top_position 20. Row B has 90 impressions, 3 clicks and sum_top_position 450. Add the contributions: 100 impressions, 5 clicks and a position sum of 470. CTR is 5/100 = 5%; average position is 470/100 + 1 = 5.7.
Compare the tempting wrong answers
Keeping only A reports 20% CTR and position 3. Keeping only B reports about 3.33% and position 6. Averaging those row ratios gives about 11.67% CTR and position 4.5. None equals the aggregate result because the rows contribute different impression counts. Conversely, do not blindly sum repeated ingestion of the very same export snapshot. This calculator assumes the supplied source rows belong to one declared partition version; proving ingestion lineage is outside its arithmetic.
Run the local calculator and its counterexamples
Download aggregate.py, filled-input.json and test_aggregate.py into one folder. Python 3.10 or newer is sufficient. The program checks that all declared dimensions match, rejects a URL-table field in this site-table exercise, adds the supplied metric contributions and returns null ratios when total impressions are zero. It does not call BigQuery or Search Console, configure billing, recover anonymised queries or authenticate the supplied partition reference.
State what the output can support
For an actual reporting handover, retain the source table and partition revision, complete selected dimensions, extraction query, input rows and calculated totals. Expand the grouping only when the business question calls for it. This example demonstrates arithmetic on supplied records; the existing export-coverage review establishes a different prerequisite. GSC average position is not a fixed-keyword rank tracker, and neither CTR nor impressions establish an enquiry, sale or AI recommendation.
Filled review cases
All examples are synthetic teaching records, not client results or live search measurements. Scroll the table on narrow screens.
| Input | Output | Interpretation |
|---|---|---|
| A · 10/2/20 plus 90/3/450 at one grain | 100 impressions; 5 clicks; CTR 0.05; position 5.7 | Sum before dividing |
| B · Same dimensions, second row removed | CONTRIBUTION_LOST | Repeated keys alone do not justify deletion |
| C · One row changes device to desktop | MIXED_GRAIN | Separate or explicitly regroup the source |
| D · Zero impressions, clicks and position sum | NULL_RATIOS | Do not invent a zero position |
Deliver the evidence
- Retain one table and partition-version reference with the supplied rows.
- Validate dimensions, then add metrics before calculating ratios.
- Compare the recorded result and run the mixed-grain and zero-denominator tests.
Google supporting guidance · Supporting passages checked 6 November 2026. Case labels and review procedures are our original teaching design; they are not Google certification rules.
filled-review.json · README.txt · aggregate.py · filled-input.json · actual-output.json · test_aggregate.py
python3 -B aggregate.py filled-input.json
python3 -B -m unittest -v test_aggregate.py