shyam2794 opened a new issue #3728: Can Filter values be passed as a parameter 
to query 
URL: https://github.com/apache/incubator-superset/issues/3728
 
 
   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 .  
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to