lilila commented on issue #11078:
URL: 
https://github.com/apache/incubator-superset/issues/11078#issuecomment-699765989


   Hi Villebro, 
   If I want to add a min / max filter on a field (since the filter box does 
not allow this) I usually create a SQL Lab view as follows :
   
   `SELECT 
   -5 as min_sem_tracking, 
   1 as max_sem_tracking
   `
   Then I create a filter  box with the 2 fields created in this "fake" table : 
   <img width="1089" alt="Screenshot 2020-09-28 at 06 35 50" 
src="https://user-images.githubusercontent.com/607430/94391078-dbb6c100-0154-11eb-9ad5-7b17202a4bc8.png";>
   
   After adding the filter box in the dashboard I use the user input value for 
min and max value to create more "complex"  filters on another table.  As 
explain above I collect user inputs using `filter_values` 
   
   ```
   {% set min_tracking  = filter_values('min_sem_tracking', -9 )[0] %} 
   {% set max_tracking = filter_values('max_sem_tracking', 2 )[0]  %} 
   ```
   
   Then I use the collected values to create filters on another field in 
another table : 
   
   ```
   SELECT * FROM my_table 
   WHERE 
   sem_tracking > {min_tracking} AND sem_tracking < {max_tracking} 
   ```
   
   With the new restriction, I receive an error message saying 
`min_sem_tracking` and `max_sem_tracking` are not in the datasource.  
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to