Sunday, January 13, 2013

yogi_Aggregate Text With No Numeric Values

                                          Google Spreadsheet  Post  #968
Yogi Anand, D.Eng, P.E.      ANAND Enterprises LLC -- Rochester Hills MI    Jan 13, 2013
user Stephen Dishman said:(!category-topic/docs/spreadsheets/how-do-i/desktop/-GZgAL66pOc)
How can I aggregate text with no numeric values?
I'd like to aggregate some data that doesn't include any numbers.  I have a list of Applications, made up of application components, made up of application elements.  Here's my query:

=QUERY('App Elements'!A1:C99,"SELECT A, B GROUP BY A, B ORDER BY A, B")
Pretty simple, but I get the following error.
error: Invalid query:  Cannot use GROUP BY when no aggregations are defined in SELECT.

A sample of my data is

   A       B       C
1  App 1   Comp 1  Ele 1
2  App 1   Comp 1  Ele 2
3  App 1   Comp 2  Ele 1
4  App 2   Comp 1  Ele 1
5  App 2   Comp 1  Ele 2

Desired results

   A       B
1  App 1   Comp 1
2  App 1   Comp 2
3  App 2   Comp 1

I can add a dummy column to average or sum and then hide the results, but surely there is a more legitimate way of getting this output.

thanks for any help
following is a solution to the problem