title: Google Data Studio: Creating Ranking Dimension
body: <p>I would like to create a ranking dimension in one of the Google Data Studio reports.</p>
  
  <p>The data source for the report is [GSC Site] which has information on [Query] (a dimension) and [Average Ranking] (a metric). Trying to use the CASE formula to create a new field called "Ranking" as follows:</p>
  
  <pre><code>CASE
      WHEN Average Position &gt;= 0 AND Average Position &lt;= 5 THEN "Top 5"
      WHEN Average Position &gt; 5 AND Average Position &lt;= 10 THEN "Top 10"
      ELSE "Not Ranked"
  END
  </code></pre>
  
  <p>and get the message "Only numeric literals are allowed if aggregated fields are used in CASE."</p>
  
  <p>As I understand, the field "Average Ranking" is metric with default aggregation "Auto" which prevents me from using the CASE formula.</p>
  
  <p>What would be a possible solution where a new field is created as  (i.e. dimension) with default aggregation "None" and populated with the above-ranking distribution values (Top 5, Top 10 and Not Ranked).</p>