Exposed filter - based on first three number in Zipcode? I have been using Basic Exposed Filter for filtering the zipcode(Number) field.

Now, I want to filter based on the first three number, though the 5 digits number is entered.

How do I achieve this ?
Please check this link

Is has an example how to implement query alter having exposed filters.

function hook_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  // (Example assuming a view with an exposed filter on node title.)
  // If the input for the title filter is a positive integer, filter against
  // node ID instead of node title.
  if ($view-&gt;id() == 'my_view' &amp;&amp; is_numeric($view-&gt;exposed_raw_input['title']) &amp;&amp; $view-&gt;exposed_raw_input['title'] &gt; 0) {
    // Traverse through the 'where' part of the query.
    foreach ($query-&gt;where as &amp;$condition_group) {
      foreach ($condition_group['conditions'] as &amp;$condition) {
        // If this is the part of the query filtering on title, chang the
        // condition to filter on node ID.
        if ($condition['field'] == 'node.title') {
          $condition = array(
            'field' =&gt; 'node.nid',
            'value' =&gt; $view-&gt;exposed_raw_input['title'],
            'operator' =&gt; '=',
          );
        }
      }
    }
  }
}