|
|
|
|
@ -236,12 +236,12 @@ To optionally customize the default series name formatting, refer to [Standard o |
|
|
|
|
|
|
|
|
|
```sql |
|
|
|
|
SELECT |
|
|
|
|
$__timeGroup(time_date_time, '5m') as time, |
|
|
|
|
$__timeGroupAlias(time_date_time, '5m'), |
|
|
|
|
min("value_double"), |
|
|
|
|
'min' as metric |
|
|
|
|
FROM test_data |
|
|
|
|
WHERE $__timeFilter(time_date_time) |
|
|
|
|
GROUP BY $__timeGroup(time_date_time, '5m') |
|
|
|
|
GROUP BY time |
|
|
|
|
ORDER BY 1 |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
@ -260,18 +260,18 @@ Data frame result: |
|
|
|
|
|
|
|
|
|
### Time series query examples |
|
|
|
|
|
|
|
|
|
**Using the fill parameter in the $\_\_timeGroup macro to convert null values to be zero instead:** |
|
|
|
|
**Using the fill parameter in the $\_\_timeGroupAlias macro to convert null values to be zero instead:** |
|
|
|
|
|
|
|
|
|
```sql |
|
|
|
|
SELECT |
|
|
|
|
$__timeGroup(createdAt, '5m', 0) as time, |
|
|
|
|
$__timeGroupAlias(createdAt, '5m', 0), |
|
|
|
|
sum(value) as value, |
|
|
|
|
hostname |
|
|
|
|
FROM test_data |
|
|
|
|
WHERE |
|
|
|
|
$__timeFilter(createdAt) |
|
|
|
|
GROUP BY |
|
|
|
|
$__timeGroup(createdAt, '5m', 0), |
|
|
|
|
time, |
|
|
|
|
hostname |
|
|
|
|
ORDER BY 1 |
|
|
|
|
``` |
|
|
|
|
@ -295,12 +295,12 @@ Data frame result: |
|
|
|
|
|
|
|
|
|
```sql |
|
|
|
|
SELECT |
|
|
|
|
$__timeGroup(time_date_time, '5m'), |
|
|
|
|
$__timeGroupAlias(time_date_time, '5m'), |
|
|
|
|
min(value_double) as min_value, |
|
|
|
|
max(value_double) as max_value |
|
|
|
|
FROM test_data |
|
|
|
|
WHERE $__timeFilter(time_date_time) |
|
|
|
|
GROUP BY $__timeGroup(time_date_time, '5m') |
|
|
|
|
GROUP BY time |
|
|
|
|
ORDER BY 1 |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|