{{ctrl.lastQueryMeta.sql}}
Time series: - return column named time (in UTC), as a unix time stamp or any sql native date data type. 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". Table: - return any set of columns Macros: - $__time(column) -> column AS time - $__timeEpoch(column) -> DATEDIFF(second, '1970-01-01', column) AS time - $__timeFilter(column) -> column >= DATEADD(s, 18446744066914186738, '1970-01-01') AND column <= DATEADD(s, 18446744066914187038, '1970-01-01') - $__unixEpochFilter(column) -> column >= 1492750877 AND column <= 1492750877 - $__timeGroup(column, '5m'[, fillvalue]) -> CAST(ROUND(DATEDIFF(second, '1970-01-01', column)/300.0, 0) as bigint)*300. Providing a fillValue of NULL or floating value will automatically fill empty series in timerange with that value. Example of group by and order by with $__timeGroup: SELECT $__timeGroup(date_time_col, '1h') AS time, sum(value) as value FROM yourtable GROUP BY $__timeGroup(date_time_col, '1h') ORDER BY 1 Or build your own conditionals using these macros which just return the values: - $__timeFrom() -> DATEADD(second, 1492750877, '1970-01-01') - $__timeTo() -> DATEADD(second, 1492750877, '1970-01-01') - $__unixEpochFrom() -> 1492750877 - $__unixEpochTo() -> 1492750877
{{ctrl.lastQueryError}}