Data Studio
2.1K members online now
2.1K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Trying to create metric for ratio of pageviews for groups of network domains

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm trying to create a metric that will be the ratio of pageviews for a certain group of network domains to pageviews from another group of network domains.

 

Does anyone have a simple solution to this?

 

Thanks for your help.

Marked as Best Answer.
Solution
Accepted by topic author Noel K
February 2017

Re: Trying to create metric for ratio of pageviews for groups of network domains

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭
Use a Calculated metric...

CASE
WHEN (networkDomains="xxx" OR networkDomains="yyy") THEN Pageviews
ELSE 0
END

Help page:
https://support.google.com/360suite/datastudio/answer/7020724?hl=en#comparison_operators

Video:
https://www.youtube.com/watch?v=dOMC3ArtTyU&index=6&list=PLFwbZ-mNsefWTL5EFcbmXCvPizGew9Jed

Thanks

Phil.

Trying to create metric for ratio of pageviews for groups of network domains

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you very much Phil!  That helped.

Trying to create metric for ratio of pageviews for groups of network domains

[ Edited ]
Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆

This works?   I thought we couldn't mix Metrics and Dimensions.

 

Why is this the accepted answer — it doesn't work:

 

Screen Shot 2017-08-25 at 1.28.28 PM.png

Trying to create metric for ratio of pageviews for groups of network domains

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

There an error "An expression can have either metrics, or dimensions, but not both.".

 

Need to know the correct answer to solve my custom metric pageviews problem too.

Trying to create metric for ratio of pageviews for groups of network domains

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Yeah how did you get this to work? that's mixing metrics & dimensions...