Problem with my Field Filters

I have the following query:

SELECT 
    one.b ,
    one.c,
    two.d,
    two.e,
    two.f
FROM 
(SELECT
a,
b,
c
FROM tablea
LEFT JOIN tableb
	ON tableb.pkey= tablea.pkey
WHERE tablea.variable_in_commun= {{variable_in_commun}}) AS one
FULL JOIN 
(SELECT
a,
d,
e,
f
FROM tablec
LEFT JOIN tabled
	ON tabled.key= tablec.key
WHERE tablec.variable_in_commun= {{variable_in_commun}}
) AS two
on one.a= two.a

My problem is: I want variable_in_commun to have the same value in queries one and two. Can I do this? as soon as I did, I would need two filters for the query to work. variable_in_commun must be given a date range (eg 30 days).

Hi @Helena
Since Field Filters references the table, then it would require separate variables for something like that:
https://www.metabase.com/learn/building-analytics/sql-templates/field-filters.html
You would have to use two simple Date filters instead:
https://www.metabase.com/learn/building-analytics/sql-templates/sql-variables.html

1 Like