How to subsetting from a field filter with a where condition in the query

Hi everone,

I've created this widget where i need to use a field filter (reftypeid) and the where condition which is

WHERE "dm_metabase_dev"."lv2_trip_aggregate_hour_new"."aggtype" = 'VEHICLE'
and "dm_metabase_dev"."lv2_trip_aggregate_hour_new"."fleet" = '301'

The main problem is that once i use 'reftypeid' as a field filter it shows me every value in the dataset and not the values related to my where conditions, as it showed in the screen below

How can i solve this ?

Hi @aresb
Try searching the forum, this question has been asked many times before, example Is is possible to limit the options shown in a field filter, depending on a SQL condition