superset icon indicating copy to clipboard operation
superset copied to clipboard

Can Filter values be passed as a parameter to query

Open shyam2794 opened this issue 9 years ago • 2 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [ ] I have reproduced the issue with at least the latest released version of superset
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar

I need to calculate the percentage to Total for the revenue across each year . This is the query .

I am using mysql DB .

select col1,monthname(date),concat(round(sum(Net*100/(select sum(Net) from table_name where year(date)=2016 group by year(date))),2)) as Percentage from table_name where year(date)=2016 group by col1,monthname(date)

Here the logic is calculated only for the year 2016 . But i want this query to be parameterised where based on the selection in the Filter box, the above should work . If a user selects a year 2015 , then 2015 has to be passed to the query . Is this is possible ?? If so can you explain how this can be done .

Superset version

version 20.4

Expected results

Actual results

Steps to reproduce

Write a query in the sql lab and try to pass the values from the filter box to the query .

shyam2794 avatar Oct 27 '17 11:10 shyam2794

@shyam2794 Do you implemented that passing parameters to the query

Geetha-LMI avatar Sep 17 '18 09:09 Geetha-LMI

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '19 15:04 stale[bot]