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

Allow creating datasources from a custom SQL query, when using the filter_values function. #8921

Open
FredericoCoelhoNunes opened this issue Jan 3, 2020 · 1 comment
Labels

Comments

@FredericoCoelhoNunes
Copy link

@FredericoCoelhoNunes FredericoCoelhoNunes commented Jan 3, 2020

Is your feature request related to a problem? Please describe.
My problem arises when I want to create a chart that responds to filters in the dashboard in a customized way, making use of the templating engine and the filter_values() function.
I usually know what SQL query I need, so I go to SQL Lab, write the query with the filter_values() function already included, and... no values are returned. I can't "explore" the results and create my chart!
What I usually do (which is what frustrates me) is: I create a version of the query which returns some results (with placeholder values for the filters), and then in the chart I edit my datasource and add all the filter_values() lines.

Describe the solution you'd like
I would like it to be possible to add datasources directly from SQL code, with a better interface for changing these datasources (currently it's a tiny text box when I click the grey Datasource box in the Chart tab).
I would also like to be able to name these datasources something other than null.my_username-query_name-random_string.

Describe alternatives you've considered
An alternative would be allowing the user to "explore" queries that return no results directly from SQL Lab, because queries with the filter_values() function can only ever return results when inside a dashboard with the respective filters.

Additional context
None.

@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Jan 3, 2020

Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.85. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.