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 Slice support for arbitrary queries (including parameterization) #1203

Closed
Jparks2532 opened this issue Sep 27, 2016 · 6 comments
Closed
Labels
enhancement:request Enhancement request submitted by anyone from the community

Comments

@Jparks2532
Copy link

Slice support for arbitrary queries (including parameterization) would enable all types of use cases where a materialized table or view doesn't quite work. For instance, the following query template could serve as the source for a Slice:

query:

SELECT
    dim,
    SUM(cnt) AS first_moment
    SUM(cnt*cnt) AS second_moment
FROM (
    SELECT id_user, <dimension1> AS dim, COUNT(*) cnt
    FROM table1
    WHERE ds between '<date_start>' and '<date_end>'
    GROUP BY id_user, <dimension1> 
) t
GROUP BY dim;

Users could pass in parameters at query time.

date_start: date
date_end: date
dimension1: string
@bkyryliuk bkyryliuk added the enhancement:request Enhancement request submitted by anyone from the community label Sep 27, 2016
@yejianye
Copy link
Contributor

Very interesting idea, how will that work with 'group by', 'metrics' parameters in various viz types?

@Jparks2532
Copy link
Author

The "query parameters" would be completely independent of the typical "group by" and "metrics" fields.

@yejianye
Copy link
Contributor

Since almost every type of visualization requires 'groupby' and 'metrics'
parameters, how could we visualize those query-based slices without them?

Jparks2532 notifications@github.com于2016年9月28日周三 上午10:28写道:

The "query parameters" would be completely independent of the typical
"group by" and "metrics" fields.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1203 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADkrK-d9bPzxaOcg1AnVekRwPphhCnxks5quqPUgaJpZM4KH2PG
.

@Jparks2532
Copy link
Author

Please don't get too hung up on the example that I provided. It's mainly there to show how you can pass in parameters into an arbitrary query.

@shivaachari
Copy link

is this feature implemented in Superset?

@mistercrunch
Copy link
Member

Yes pretty much, by following the "Visualize" button in SQL lab you're essentially running the explore view against your SQL statement as a subquery, and this SQL statement can be templated and receive url parameters.

@dpgaspar dpgaspar mentioned this issue Dec 9, 2019
12 tasks
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
* fix(plugin-chart-echarts): add gauge cross filtering

* fix(plugin-chart-echarts): fix lint

* fix(plugin-chart-echarts): use constants
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
* fix(plugin-chart-echarts): add gauge cross filtering

* fix(plugin-chart-echarts): fix lint

* fix(plugin-chart-echarts): use constants
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
* fix(plugin-chart-echarts): add gauge cross filtering

* fix(plugin-chart-echarts): fix lint

* fix(plugin-chart-echarts): use constants
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
* fix(plugin-chart-echarts): add gauge cross filtering

* fix(plugin-chart-echarts): fix lint

* fix(plugin-chart-echarts): use constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement:request Enhancement request submitted by anyone from the community
Projects
None yet
Development

No branches or pull requests

5 participants