diff --git a/public/app/plugins/datasource/mssql/partials/query.editor.html b/public/app/plugins/datasource/mssql/partials/query.editor.html index b957023e9c4..e24b004822b 100644 --- a/public/app/plugins/datasource/mssql/partials/query.editor.html +++ b/public/app/plugins/datasource/mssql/partials/query.editor.html @@ -38,7 +38,7 @@
Time series:
-- return column named time (in UTC), as a unix time stamp or any sql native date datatype. you can use the macros below.
+- return column named time (in UTC), as a unix time stamp or any sql native date datatype. You can use the macros below.
- optional: return column named metric to represent the series names.
- any other columns returned will be the time point values.
- if multiple value columns are present and a metric column is provided. the series name will be the combination of "MetricName - ValueColumnName".
@@ -50,14 +50,15 @@ Macros:
- $__time(column) -> column AS time
- $__utcTime(column) -> DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), column) AS time
- $__timeEpoch(column) -> DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), column) ) AS time
-- $__timeFilter(column) -> column > DATEADD(s, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01') AND column < DATEADD(s, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
-- $__unixEpochFilter(column) -> column > 1492750877 AND column < 1492750877
+- $__timeFilter(column) -> column > DATEADD(s, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01') AND column < DATEADD(s, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
+- $__unixEpochFilter(column) -> column > 1492750877 AND column < 1492750877
+- $__timeGroup(column, '5m'[, fillvalue]) -> cast(cast(DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second, GETDATE(), GETUTCDATE()), column))/300 as int)*300 as int). Providing a fillValue of NULL or floating value will automatically fill empty series in timerange with that value.
Or build your own conditionals using these macros which just return the values:
-- $__timeFrom() -> DATEADD(second, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
-- $__timeTo() -> DATEADD(second, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
-- $__unixEpochFrom() -> 1492750877
-- $__unixEpochTo() -> 1492750877
+- $__timeFrom() -> DATEADD(second, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
+- $__timeTo() -> DATEADD(second, 1492750877+DATEDIFF(second,GETUTCDATE(),GETDATE()), '1970-01-01')
+- $__unixEpochFrom() -> 1492750877
+- $__unixEpochTo() -> 1492750877