title: Select and display data as column header
body: <p>I want to select region wise data and want to show each region as column header.</p>
  
  <p>My data:</p>
  
  <pre><code>region state   status
  North   UP     invalid
  North   HAR    invalid
  North   MAH     valid
  South   KER     valid
  South   TAM     valid
  South   KAR     valid
  South   KAR     invalid
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Status   North  south  total 
  invalid   2      1      3
  valid     1      3      4
  total     3      4      7
  </code></pre>
  
  <p>How to do this?
  This regions can be update later new region can be  added later</p>
  
  <p>Is there any way to take all the active regions first then use this in the query
  activeregions</p>