---
title: "Recalculate table totals for the filtered dataset"
description: "Verify that a table summary follows its documented filtered-dataset scope instead of showing a stale total or only the current page subtotal."
canonical_url: "https://vostride.com/agent-library/data-tables/summary-matches-filter.md"
md_url: "https://vostride.com/agent-library/data-tables/summary-matches-filter.md"
content_kind: "recipe"
topic: "data-tables"
---

# Recalculate table totals for the filtered dataset

Verify that a table summary follows its documented filtered-dataset scope instead of showing a stale total or only the current page subtotal.

## Risk

Summary totals can be computed from cached full data or visible rows. Define the scope explicitly and choose a fixture where full, filtered, and current-page totals all differ.

## Fixtures

- A test workload table has six rows with hours 1, 2, 3, 4, 5, 6; the first four belong to Team Cedar.
- The page size is two, and the contract totals all filtered rows across pages.
- The independent expected totals are full dataset 21, Cedar dataset 10, and Cedar first page 3 under ascending hours.

## Steps

1. Open the workload table and verify its unfiltered Hours total is 21.
2. Filter Team Cedar and verify the summary changes to 10 while the first page shows hours 1 and 2.
3. Go to the second filtered page and verify hours 3 and 4 are visible while the summary remains 10.
4. Clear the team filter and verify the total returns to 21.
5. Reload with the product-defined saved filter state and verify the displayed scope label, row membership, and total agree.

## Expected results

- The filtered summary equals 10 from the independent four-row Cedar oracle.
- Paging within the filtered set does not change the dataset-wide total.
- Removing the filter restores the full total of 21 without changing any stored hour values.

## False-pass traps

- A total of 3 would be correct for visible rows but wrong for this specified summary scope.
- Verifying only the summary label can miss stale numerical values after filtering.

## Cleanup

- Delete the six workload fixtures and reset team filters and sort preferences.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Data table QA recipes](/agent-library/data-tables.md)
- [Software factory QA library](/agent-library.md)
