{{ctrl.lastQueryMeta.sql}}
Time series: - return column named time (UTC in seconds or timestamp) - return column(s) with numeric datatype as values - (Optional: return column named metric to represent the series name. If no column named metric is found the column name of the value column is used as series name) Table: - return any set of columns Macros: - $__time(column) -> column as "time" - $__timeEpoch -> extract(epoch from column) as "time" - $__timeFilter(column) -> column ≥ to_timestamp(1492750877) AND column ≤ to_timestamp(1492750877) - $__unixEpochFilter(column) -> column > 1492750877 AND column < 1492750877 To group by time use $__timeGroup: -> (extract(epoch from column)/extract(epoch from column::interval))::int Example of group by and order by with $__timeGroup: SELECT min(date_time_col) AS time_sec, sum(value_double) as value FROM yourtable group by $__timeGroup(date_time_col, '1h') order by $__timeGroup(date_time_col, '1h') ASC Or build your own conditionals using these macros which just return the values: - $__timeFrom() -> to_timestamp(1492750877) - $__timeTo() -> to_timestamp(1492750877) - $__unixEpochFrom() -> 1492750877 - $__unixEpochTo() -> 1492750877
{{ctrl.lastQueryError}}