renzhe-brian opened a new issue, #21966:
URL: https://github.com/apache/superset/issues/21966

   
   For some of our use cases, we must include templating values from the 
selected time range when defining our virtual dataset. Eg, use `{{ from_dttm}}` 
and `{{to_dttm}}`. Then we create a chart from this dataset and include it in a 
dashboard. The functionality of templating works and the chart changes 
correctly when applying different date ranges. 
   
   However, when adding filters on other columns within the dataset, The filter 
box cannot get existing values.
   
   #### How to reproduce the bug
   
   1. define a test dataset with following sql:
   ```
   with example_data as (
   SELECT 1 as col1, 'a' as col2, to_date('20221001','yyyyMMdd') as dt
   union 
   SELECT 2 as col1, 'b' as col2, to_date('20221002','yyyyMMdd') as dt
   union 
   SELECT 3 as col1, 'c' as col2, to_date('20221003','yyyyMMdd') as dt
   )
   select * from example_data
   where dt  >= '{{ from_dttm }}'
       AND dt < '{{ to_dttm }}'
   ```
   2. create a simple chart with configs in the picture , using dataset from 
step1
   <img width="1774" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198672853-7a2c94f4-1e14-4af8-a0df-31d94e538a76.png";>
   
   3. create a dashboard with the chart in step 2 and add some filters on the 
columns
   <img width="890" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198675297-aa93b33d-c0a1-4928-835d-0fce3324ddbf.png";>
   <img width="890" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198675337-b8d1fa65-8dd4-494a-b858-dfd2350b8d61.png";>
   <img width="890" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198675373-e43a20cb-2897-4542-be40-f98ace312b34.png";>
   
   
   ### Expected results
   The filters on the left side should contain some values
   <img width="1248" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198668772-9344f8af-9c0a-4450-90c1-13d7370e7a68.png";>
   
   
   ### Actual results
   The filters on the left side does not show any value
   <img width="1336" alt="image" 
src="https://user-images.githubusercontent.com/42205607/198671046-2538d6eb-3b01-47fc-978c-3253ebb35aa4.png";>
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: `Version 107.0.5304.87 (Official Build) (x86_64)`
   - superset version: `superset:2.0.0`
   - python version: `python 3.8`
   
   
   
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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