Google Sheets - Pivot Tables

<img src='http://chart.apis.google.com/chart
 ?cht=p3&chs=450x200&chd=t:2,4,3,1&chl=Phones|Computers|Services|Other
 &chtt=Company%20Sales&chco=ff0000'>

http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:8,7,6
&chl=Plan1|Plan2|Plan3&chtt=MyPDP%20Plan
&chco=ff0000
  1. On your computer, open Google Sheets. https://docs.google.com/spreadsheets/u/0/
  2. Open the spreadsheet with the data you want to put in a table.
  3. Select the cells with data you want to use.
    1. Put the data you want to use into columns. Each column is one data set.
    2. Each column needs a header.
  4. In the menu, click Data and then Pivot table. Click the pivot table sheet, if it’s not already open.
  5. Next to each category in the “Report editor” window, click Add field, then click a column to use.

Your table has one row or column for each number in the column you use, even if the number is in more than one cell.

Data from the columns you use for “Values” is sorted into the matching rows and columns.

If you want to add a field to the “Values” category that calculates values based on a formula,

click Calculated field and enter the formula.

To format the pivot tables, use the buttons in the toolbar.

Change or remove data

PHP MySQL

select week, 
    count(*) as total, 
    sum(technical) as technical, 
    sum(non_technical) as non_technical) 
from(
    select week, 
    case(type) when 'Technical' then 1 else 0 END as technical, 
    case(type) when 'Non-Technical' then 1 else 0 END as non_technical
) as data
GROUP BY week