# Thresholds

{% hint style="success" %}
Run this example using its test data from within [FlightPath Data](https://www.flightpathdata.com/).
{% endhint %}

```
~
 This csvpath finds all the new high-value thresholds in a CSV file.
 It gives the same output as this SQL:

    SELECT
       id,
       worker_hours_this_period
    FROM(
       SELECT
          id,
          worker_hours_this_period,
          MAX(worker_hours_this_period)
  	 OVER (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS max_prev_value
       FROM
          projects
     ) AS subquery
    WHERE
       worker_hours_this_period > max_prev_value OR max_prev_value IS NULL;

 id: New high value
 test-data: examples/headers/projects_with_reset.csv
~
$[1*][
    @hours.onchange.increase = float(#worker_hours_this_period)

    print.onmatch("line: $.csvpath.line_number: $.variables.hours")
]

```


---

# Agent Instructions: 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/thresholds.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.
