title: How do I map one variable's values to another variable in Grafana?
body: <p>In my Grafana dashboard (with Prometheus as a data source), I have a custom <code>$tier</code> variable, which allows the user to pick the tier from a dropdown. It's defined as:</p>
  
  <pre><code>Values separated by comma: production, stage, development
  </code></pre>
  
  <p>I need to filter a Prometheus metric by a label which contains a <em>shortened</em> version of the tier name:</p>
  
  <ul>
  <li>"foo-dev"</li>
  <li>"foo-stage"</li>
  <li>"foo-prod"</li>
  </ul>
  
  <p>I was thinking that I'd create a hidden variable <code>$shortened_tier</code> so I could use that in my query filter, like this:</p>
  
  <pre><code>my_label=~"foo-$shortened_tier"
  </code></pre>
  
  <p>I'd like to define it based on the value of <code>$tier</code>:</p>
  
  <ul>
  <li>"development" -> "dev"</li>
  <li>"stage" -> "stage"</li>
  <li>"production" -> "prod"</li>
  </ul>
  
  <p>How do I do that?</p>