diff --git a/lib/cartodb/models/dataview/aggregation.js b/lib/cartodb/models/dataview/aggregation.js index 40774353..9b5d62ef 100644 --- a/lib/cartodb/models/dataview/aggregation.js +++ b/lib/cartodb/models/dataview/aggregation.js @@ -74,7 +74,7 @@ const specialNumericValuesColumns = () => `, nans_count, infinities_count`; const rankedAggregationQueryTpl = ctx => ` SELECT - CAST(category AS text), + category, value, false as agg, nulls_count, @@ -109,7 +109,7 @@ const rankedAggregationQueryTpl = ctx => ` const aggregationQueryTpl = ctx => ` SELECT - CAST(${ctx.column} AS text) AS category, + ${ctx.column} AS category, ${ctx.aggregationFn} AS value, false as agg, nulls_count,