Transform: Add a limit transform (#49291)
* Add a limit transform * Add a limit transform * Simplify filter code Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
co-authored by
Dominik Prokop
parent
062d255124
commit
7d7890e23c
@@ -545,3 +545,26 @@ Here is the result after applying the Series to rows transformation.
|
||||
## Sort by
|
||||
|
||||
This transformation will sort each frame by the configured field, When `reverse` is checked, the values will return in the opposite order.
|
||||
|
||||
## Limit
|
||||
|
||||
Use this transformation to limit the number of rows displayed.
|
||||
|
||||
In the example below, we have the following response from the data source:
|
||||
|
||||
| Time | Metric | Value |
|
||||
| ------------------- | ----------- | ----- |
|
||||
| 2020-07-07 11:34:20 | Temperature | 25 |
|
||||
| 2020-07-07 11:34:20 | Humidity | 22 |
|
||||
| 2020-07-07 10:32:20 | Humidity | 29 |
|
||||
| 2020-07-07 10:31:22 | Temperature | 22 |
|
||||
| 2020-07-07 09:30:57 | Humidity | 33 |
|
||||
| 2020-07-07 09:30:05 | Temperature | 19 |
|
||||
|
||||
Here is the result after adding a Limit transformation with a value of '3':
|
||||
|
||||
| Time | Metric | Value |
|
||||
| ------------------- | ----------- | ----- |
|
||||
| 2020-07-07 11:34:20 | Temperature | 25 |
|
||||
| 2020-07-07 11:34:20 | Humidity | 22 |
|
||||
| 2020-07-07 10:32:20 | Humidity | 29 |
|
||||
|
||||
Reference in New Issue
Block a user