Fix order in categories query to make it compatible with lenyends

This commit is contained in:
Daniel García Aubert 2016-10-26 13:16:24 +02:00
parent eb323fbff9
commit c20fd9691a

View File

@ -32,7 +32,7 @@ methodTemplates.category = dot.template([
' SELECT {{=it._column}} AS category, count(1) AS value, row_number() OVER (ORDER BY count(1) desc) as rank', ' SELECT {{=it._column}} AS category, count(1) AS value, row_number() OVER (ORDER BY count(1) desc) as rank',
' FROM ({{=it._sql}}) _cdb_aggregation_all', ' FROM ({{=it._sql}}) _cdb_aggregation_all',
' GROUP BY {{=it._column}}', ' GROUP BY {{=it._column}}',
' ORDER BY 2 DESC', ' ORDER BY 2 DESC, 1 ASC',
'),', '),',
'agg_categories AS (', 'agg_categories AS (',
' SELECT category', ' SELECT category',