Use one variable to filter multiple fields/columns of the same data type

Is there a way to use a single variable to filter two or more fields/columns?

WHERE {{date_range}} AND “MOVPDV”.“MOVTO” = ‘VE’) -
WHERE {{date_range}}) AS “VENDAS”

I wish to use a single date selector {{date_range}} to filter “MOVPDV”.“DATA” and “DEVOLUC”.“EMISSAO”.

Hi @coutoreis
You cannot use Field Filters with aliases, so since it’s two different tables, then it would not be possible.
Go and upvote this issue by clicking :+1: on the first post:

@flamber :expressionless: Oh, I’m kinda frustrated here. I need to calculate the profit based in one table (sellings) minus other table (devolutions/cancelations). That’s what the code I posted is for. Is there any workaround to filter the date in both tables?

Ps.: I upvoted the referenced issue.

You should be able to do something with sub-queries, if you don’t want to use two simple Date filters. There’s an example in the issue:

1 Like

Hi @coutoreis
I had a similar issue here.
I didn’t know the name sub-query before the @flamber’s post, but it really works for in my case.