Thematches_filterfunction applies the filter expression to the field and returnsYesif the value in the field matches the filter expression orNoif it does not.
Examples
This example returnsYesin a custom field if the invoice date is less than 30 days old:
Use theiffunction withmatches_filterto return different values. The next example shows syntax of a custom field that returns "Late" if the invoice date is over 30 days old:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 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."]]