Rainer
September 14, 2022, 2:06pm
1
This query works, of course:
select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT 50
If I replace the limit value with a component value, no result comes up:
select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT {{select_count_hosts.value}}
or
select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT {{parseInt(select_count_hosts.value)}}
What am I doing wrong?
ScottR
September 14, 2022, 2:23pm
2
count should not be in single quotes but you may want to read about AlaSQL Limit · AlaSQL/alasql Wiki · GitHub
Rainer
September 15, 2022, 6:04am
3
Since "count" is a column, it must be enclosed in quotation marks. Otherwise it will be treated as a keyword.
The limit call is also logical for me.
Only why can't I include a variable?
Hey @Rainer ! It looks like this is an underlying issue with AlaSQL, would it be possible to limit the results of your query with a JS transformer since the data has already been brought into your frontend?