Monday, January 11, 2016

yogi_In Table A:K Count Number Of Instances Of Each Entry In Column K

Google Spreadsheet   Post  #2014
Yogi Anand, D.Eng, P.E.      ANAND Enterprises LLC -- Rochester Hills MI   Jan-10-2016
post by: MSG Crane:!topic/docs/umbbrIQPzVU;context-place=forum/docs
Using multiple "count() where" arguments in a Google Query

Hoping for a little help...  I am building a charts dashboard and one of the charts is a line chart depiction of the total number of records that meet the following criteria in column "K":  "Start Usage", "Midpoint", and "End Usage".

In the end, I would like the query result to show the following so I can graph each submission type with different lines on the chart:

|    A   |                     B                  |                 C               |                 D                   |
|Date | Count of Start Usage | Count of Midpoint | Count of End Usage |

I feel like the way to do this is three iterations of count() where K = "???" on column D.  I can get it to work with one iteration of "count() where" but I cannot figure out how to get it to work three times in the same query... 

This works:
select A, count(D) where K = 'Start Usage' group by A

Query as it stands right now with coloring for clarity (need help):
select A, count(D) where K = 'Start Usage' label 'Count of Start Usage', count(D) where K = 'Midpoint' label 'Count of Midpoint', count(D) where K = 'End Usage' label 'Count of End Usage' group by A