> For the complete documentation index, see [llms.txt](https://www.csvpath.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csvpath.org/getting-started/the-flightpath-data-examples/counting.md).

# Counting

{% hint style="warning" %}
**Try these examples yourself.** They are built into FlightPath Data. You can download FlightPath Data free from [Microsoft](https://apps.microsoft.com/detail/9P9PBPKZ4JDF) or [Apple](https://apps.apple.com/us/app/flightpath-data/id6745823097) or [Github](https://github.com/dk107dk/flightpath)
{% endhint %}

These examples show different ways to craft CSV and Excel validation rules for counting lines and header values.

There are a number of ways to do similar counts that have separate purposes but which overlap. For example:

* `increment()` adds 1 each N times a match component evaluates to True
* `counter()` adds N each time a match component evaluates to True
* `every()` adds 1 every N-times a value is seen, matching or not

Likewise, summing offers options:

* `sum()` keeps a running count of values in a header
* `count()` keeps a count of matches and, like `every()`, can also count match components it contains
* `subtotal()` tracks the running sum of a header for each value in another header
* `tally()` tracks counts of the values seen in headers or combinations of headers

<figure><img src="/files/a9rmdHtcVtXss1Gaw9tf" alt=""><figcaption></figcaption></figure>

* [Track values](/getting-started/the-flightpath-data-examples/counting/track-values.md)
* [Counters](/getting-started/the-flightpath-data-examples/counting/counters.md)
* [Tallying](/getting-started/the-flightpath-data-examples/counting/tallying.md)
* [Summing up](/getting-started/the-flightpath-data-examples/counting/summing-up.md)
* [Thresholds](/getting-started/the-flightpath-data-examples/counting/thresholds.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.csvpath.org/getting-started/the-flightpath-data-examples/counting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
