The current Value component allows you to show a single value based of a query. When a specific row pointer is supplied it will show that value. I would like to see the option to, in absence of a row pointer, to add an aggregation to this component.
Goal of Feature
This feature would allow me to be more smart in my use of SQL queries.
For example : If I have a query named issues this consist of the following SQL
select assignee, count(*) as count from issues
Before showing this query in a DataTable component or something I add some text to the start of the Markdown page and in this text I want to reference the number of unique assignees and the total number of issues I would like to do this using the Value components with the following code
Currently I can do this by adding 2 separate SQL statements and point the value component to each of them.
select distinct assignee from issues
select count(*) as count from issues
Not a big issue to do but if there are more values you would like to show in the text you add extra queries in your page that I think are not needed. So the end-result will be cleaner.
Feature Description
The current Value component allows you to show a single value based of a query. When a specific row pointer is supplied it will show that value. I would like to see the option to, in absence of a row pointer, to add an aggregation to this component.
Goal of Feature
This feature would allow me to be more smart in my use of SQL queries.
For example : If I have a query named
issues
this consist of the following SQLselect assignee, count(*) as count from issues
Before showing this query in a DataTable component or something I add some text to the start of the Markdown page and in this text I want to reference the number of unique assignees and the total number of issues I would like to do this using the Value components with the following code
<Value data={issues} column=count agg=sum />
<Value data={issues} column=assignee agg=countDistinct />
Current Solution / Workarounds
Currently I can do this by adding 2 separate SQL statements and point the value component to each of them.
select distinct assignee from issues
select count(*) as count from issues
Not a big issue to do but if there are more values you would like to show in the text you add extra queries in your page that I think are not needed. So the end-result will be cleaner.
Alternatives
See workarounds