diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js index a71962cef06..4f86cc5ad02 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/services/influxdb/influxdbDatasource.js @@ -44,7 +44,7 @@ function (angular, _, kbn) { var orderIndex = lowerCaseQueryElements.indexOf("order"); additionalGroups = lowerCaseQueryElements.slice(groupByIndex + 1, - orderIndex ? orderIndex : lowerCaseQueryElements.length).filter(function(w) { + orderIndex >= 0 ? orderIndex : lowerCaseQueryElements.length).filter(function(w) { return ! /time\(/.test(w); }); additionalGroups = _.map(additionalGroups, function(w) {