Add conditional where condition to hook_views_query_alter()
You can achieve this using switch-case or if-else in mymodule_views_query_alter.

function mymodule_views_query_alter(&amp;$view, &amp;$query) {
  //Get your variable $scope here
  switch($scope) {
    case 'G':
      $query-&gt;add_where_expression(0, "$variable = :placeholder", array(':placeholder' =&gt; 'value');      
      break;
    case 'L':
      $query-&gt;add_where_expression(0, "$another_variable = :another_placeholder", array(':another_placeholder' =&gt; 'another_value');      
      break;
  }
}


Hope this helps.