====== Google Sheets - Pivot Tables ======
* Before you pivot: https://code.tutsplus.com/tutorials/easy-graphs-with-google-chart-tools--net-11771
* The new google chart api location is here: https://developers.google.com/chart/
http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:8,7,6
&chl=Plan1|Plan2|Plan3&chtt=MyPDP%20Plan
&chco=ff0000
* http://trainingtechnologies.blogspot.com.au/2014/11/using-pivot-table-in-google-sheets.html
* https://support.google.com/docs/answer/1272900?co=GENIE.Platform%3DDesktop&hl=en
- On your computer, open Google Sheets. https://docs.google.com/spreadsheets/u/0/
- Open the spreadsheet with the data you want to put in a table.
- Select the cells with data you want to use.
- Put the data you want to use into columns. Each column is one data set.
- Each column needs a header.
- In the menu, click Data and then Pivot table. Click the pivot table sheet, if it’s not already open.
- 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.
* "Filters" hide data that you don't want to show in the table.
* You can change how your data is listed, sorted, summarized or filtered. Next to what you want to change, click the Down Arrow Down Arrow.
To format the pivot tables, use the buttons in the toolbar.
=== Change or remove data ===
* To move a data set from one category to another, drag it to the category you want.
* To remove a data set from a category, click Remove Remove.
* To expand the range of data used for your pivot table, click Edit range.
* The pivot table refreshes any time you change the cells it's drawn from.
=== PHP MySQL ===
* http://www.boynux.com/creating-pivot-reports-in-mysql/
* http://stackoverflow.com/questions/10649419/pivot-tables-php-mysql
* http://stackoverflow.com/questions/7674786/mysql-pivot-table
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