Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

ORDER BY generating error in Google Sheets' QUERY

$
0
0

I'm getting a '#Value!' error when I try to sort data returned by a QUERY statement. This is the basic statement:
=query('Raw Data'!A:G,"Select A, C, D, sum(G) where B='instagram' and (D='Female Followers Age' or D='Male Followers Age') and A <> '#N/A' group by D, C, A label A 'Handle', C 'Country', D 'Segment', sum(G) 'Share'",0)

Adding an ORDER BY statement to the end of it to sort on column A generates a #Value! error. I saw some responses on forums suggesting column numbers should be used in place of letters with the order by clause. However, I have tried replacing order by A with order by 1, but it generates the same error.

=query('Raw Data'!A:G,"Select A, C, D, sum(G) where B='instagram' and (D='Female Followers Age' or D='Male Followers Age') and A <> '#N/A' group by D, C, A label A 'Handle', C 'Country', D 'Segment', sum(G) 'Share' order by A",0)


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>