title: Change format from column to row
body: <p>I have a lot of rows of data in this format (thousands of rows!)</p>
  
  <p>They are generated from a Query</p>
  
  <pre><code>Seen Loc Qty  
  robi r 5  
  robi w 2  
  robi p 1  
  spar r 3  
  spar w 1  
  bb r 10  
  bb  p 1  
  cauv r 5  
  wate r 6  
  wate p 1 
  </code></pre>
  
  <p>And I want to get them into this format (row format)</p>
  
  <pre><code>Seen    Loc(r)  Loc(w)  Loc(p)  
  robi    5       2       1  
  spar    3       1       0  
  bb     10       0       1  
  cauv    5       0       0  
  wate    6       0       1  
  </code></pre>
  
  <p>Can anyone tell me how I can achieve that in a reasonably performance friendly manner because of the number of rows (max 25,000)?</p>
  
  <p>Ideally would like the row formatted output to be created within the same process as the Query that creates the columns (i.e. =newrowprocess(existingQuery) .... creates the row formatted output</p>
  
  <p>I have tried using Arrays and IF() statements within Arrays.</p>
  
  <p>Thanks</p>