1

I'm trying to use multiple where conditions (2 conditions) with 'group by' and 'order by' statements inside a Google Sheets Query formula.

query(Sites!A:D,"select A,C,sum(D) 
    where B contains 'Google' 
    and sum(D) > 100 
    group by A,C 
    Order by sum(D) desc label sum(D) 'Total Impressions'")

Above is the formula I tried, but it gives me an error with #VALUE!

Is it an issue with the order of statements?

ProfC
  • 47
  • 1
  • 10
StarSpirit_2000
  • 125
  • 2
  • 11

2 Answers2

1

Add a second where should work

query(Sites!A:D,"select A,C,sum(D) 
    where B contains 'Google' 
    and where sum(D) > 100 
    group by A,C 
    order by sum(D) desc label sum(D) 'Total Impressions'")
Heinz Schilling
  • 2,177
  • 4
  • 18
  • 35