A função matches_filter aplica a expressão de filtro ao campo e retorna Yes se o valor no campo corresponder à expressão de filtro ou No se não corresponder.
Examples
Este exemplo retorna Yes em um campo personalizado se a data da fatura tiver menos de 30 dias:
Use a função if com matches_filter para retornar valores diferentes. O exemplo a seguir mostra a sintaxe de um campo personalizado que retorna "Atrasado" se a data da fatura tiver mais de 30 dias:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-07-31 UTC."],[],[],null,["# matches_filter\n\nThe `matches_filter` function can be used in [custom filters](/looker/docs/filtering-and-limiting#custom-filters) and [custom fields](/looker/docs/custom-fields) to determine whether the value of a field matches a [filter expression](/looker/docs/filter-expressions).\n\n### Syntax\n\n**`matches_filter(field, ``filter expression``)`**\n\nThe `matches_filter` function applies the filter expression to the field and returns `Yes` if the value in the field matches the filter expression or `No` if it does not.\n\n### Examples\n\nThis example returns `Yes` in a custom field if the invoice date is less than 30 days old: \n\n matches_filter(${billing.invoice_date}, `30 days`)\n\nUse the [`if`](/looker/docs/functions-and-operators#functions_for_any_looker_expression_4) function with `matches_filter` to return different values. The next example shows syntax of a custom field that returns \"Late\" if the invoice date is over 30 days old: \n\n if(matches_filter(${billing.invoice_date}, `30 days`), \"Current\", \"Late\")\n\n### Things to know\n\nThe string that defines the filter expression must be enclosed in backtick (\\`) characters."]]