In Metabase, what is wrong with this query?

Guys, good afternoon!
I am doing this query to generate a dashboard, where I want to inform 2 (optional) parameters, but as you can see, it is not bringing any results. And when I only inform the customer, it is excluded from the result. How to solve this? Can you help me? Look at the attachment.

Hi @Lourival
When using Field Filters, you should not include the column.
Field Filter:

[[AND {{filter}}]]

Other filters:

[[AND column={{filter}}]]
1 Like

Hi @flamber,

I did it here and it worked, but the documentation suggests informing the column, see:

My query looks like this:

SELECT UPPER(tb_cliente.nome_orgao), 
EXTRACT(YEAR FROM tb_registrar_assinatura_cliente.ts_movimentacao) AS ANO, 
EXTRACT(MONTH FROM tb_registrar_assinatura_cliente.ts_movimentacao) AS MES, COUNT(*) AS TOTAL 
FROM tb_registrar_assinatura_cliente 
INNER JOIN tb_cliente ON = tb_registrar_assinatura_cliente.id_cliente
WHERE true
  [[AND {{CLIENTE}}]]
  [[AND {{ANO}}]]
GROUP BY tb_cliente.nome_orgao, tb_cliente.tipoassinaturapermitida, EXTRACT(YEAR FROM tb_registrar_assinatura_cliente.ts_movimentacao), EXTRACT(MONTH FROM tb_registrar_assinatura_cliente.ts_movimentacao)

No, the documentation gives an example of simple filter with column. And then it gives a Field Filter example without column:

I understand … but it is in this part of the document that I have based myself.
I see in the attachment

But that section of the documentation is specifically for Optional Clauses [[ ... ]]
You can put any type of filter into optional clauses, but you still need to follow the guide for each filter type.

I understand, in any case I have managed to resolve here and I have acquired a knowledge for the next consultations. Thanks for your attention.