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

Conditional unique pageviews calculation

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, 

 

I am trying to create a calculated field and calculate how many unique pageviews we I got on particular page.

 

I am trying to use calculated field

Unique Pageviews * MAX(CASE WHEN REGEXP_MATCH(Page, '.*/payment.php') THEN 1 ELSE 0 END)

 

But the result seems to be equal to Unique Pageviews. Any Ideas?

 

Thanks

Conditional unique pageviews calculation

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Hi,

 

It is returning you the value of Unique Pageviews because it is taking the Unique Pageviews * 1.

 

The reason is it 1 is because your CASE condition is returning 1 when the Page matches /payment.php

 

Hope this helps in your understanding.

Conditional unique pageviews calculation

Explorer ✭ ✭ ☆
# 3
Explorer ✭ ✭ ☆

You're better off using a filter with your regex condition to see the Unique Pageviews, as creating calculated fields like this doesn't work in Data Studio.