Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aggregation to the value component #1937

Open
jaroet opened this issue Apr 24, 2024 · 0 comments
Open

Add aggregation to the value component #1937

jaroet opened this issue Apr 24, 2024 · 0 comments
Assignees

Comments

@jaroet
Copy link

jaroet commented Apr 24, 2024

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 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

  • <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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants