title: Convert rows to columns in SQL Server by combining 2 columns to form the new column
body: <p>I'm trying to accomplish something related to <a href="https://stackoverflow.com/questions/15745042/efficiently-convert-rows-to-columns-in-sql-server">Efficiently convert rows to columns in sql server</a>
  The difference is I have 2 columns which need to form the new column.</p>
  <p>So I've used this example from the previously mentioned SO post, because I have 1-N columns: <a href="https://data.stackexchange.com/stackoverflow/query/497433" rel="nofollow noreferrer">https://data.stackexchange.com/stackoverflow/query/497433</a></p>
  <p>This is what I have so far: <a href="https://data.stackexchange.com/stackoverflow/query/1307538" rel="nofollow noreferrer">https://data.stackexchange.com/stackoverflow/query/1307538</a></p>
  <p>I'm just not able to figure out how I can combine the year/quarter in the 2nd (commented) query.</p>
  <p>In the end I would like:</p>
  <pre><code>Cols: 2022Q1  2022Q2  2022Q3  2022Q4  2022Q1
  Vals: 123     456     345     234     789
  </code></pre>
  <p>Any help would be greatly appreciated!</p>