Tricky mix of AND and OR operators in a filter

118 views
Skip to first unread message

Stephane

unread,
Jun 28, 2012, 9:37:56 AM6/28/12
to google-analytics...@googlegroups.com
Hi,

I'm looking for a tricky way to combine AND and OR in a filter. Basically, what I want to do is this:

Filter visits that are from organic OR visits that are form yahoo or google CPC.

ga:medium==organic OR (ga:medium==cpc AND ga:source=@google|yahoo)

Parenthesis are not allowed and the OR operator takes precedence over the AND so the above doesn't work as well as all variations I've made so far. So I'm a bit stuck here.

Any idea? 

Thanks,

Stéphane

Nick

unread,
Jun 28, 2012, 11:43:55 AM6/28/12
to google-analytics...@googlegroups.com
Tricky.

Maybe 2 queries?

or drop the medium==cpc requirement and just use ORs.

-Nick

Stephane

unread,
Jun 28, 2012, 2:30:43 PM6/28/12
to google-analytics...@googlegroups.com
Thanks for the reply. 2 queries was what I had in mind, but I was wondering if there was a way. I cannot drop the cpc because there might be other cpc sources and the client only want google and yahoo.

It would be great if we could group conditions with parenthesis like in SQL. 

Thanks,

Stéphane
Reply all
Reply to author
Forward
0 new messages