Custom SQL queries with filters
See original GitHub issueIs it possible to specify custom SQL query like using SQL Lab but with an opportunity to apply interactive FilterBox to it?
It would be really nice in tasks where you have to visualize aggregative metrics. For example, if you have smth like that: user1, log1, user2, log2, … userN, logM
And you want to plot a distribution of counters of logs for users in a following way:
SELECT counter, COUNT(*)
FROM
(SELECT user, COUNT(*) AS counter
FROM table_name
WHERE conditions_from_interactive_filter_box
GROUP BY user
) AS foo
GROUP BY counter;
If I am not mistaken you can not do it directly from Superset slices but it is a very common case.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to put filter value in custom SQL query
I have a very large table...almost billion rows. What I want to do is create a custom SQL query where a user enters...
Read more >Filters in Custom SQL - Get Help
We want to know how the filters work on custom SQL queries. Suppose we use the table data directly, we are able to...
Read more >Filtering rows from SQL Server
This example shows how to use a sub query in a Custom SQL filter to give different users access to specific regions. The...
Read more >Custom SQL Query, Filter List, Based On 2 Different ...
I have a way to list all of the devices that are currently polling volumes. And, I have a way to list the...
Read more >SQL Filtering by Custom Column
SELECT * FROM ( SELECT DISTINCT ManagerName , ProductName , slocumrank , case when SubType2ID = 45 then 'Large Cap' else SubType2Name End...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi all, I am using superset. Do you know how to Get value of Grain in filter from a query ( as a parameter {{ ??? }} )?
Hello there - We had a huge stack of our reports built using 0.20.4 which let us use custom filters that were not part of the data source in our queries, and now when we upgrade to 0.24.3 or higher we find that these custom filters are rejected or made blank at the jinja_parser stage.
Question - Is there a reason this change was done to exclude external custom filters, because we are wondering if there has been a more elegant and cleaner way to do this?
We are concerned that this feature might have been completely deprecated which sometimes aggravates our use cases by pulling a lot more data at every pull and making all the dashboards slower. Can someone please help? Thank you!