2
votes

I have one metric and one dimension I need to create a calculated field like SQL Query:

sum(new_users) where event_action= "manual_widget_click" / Total_new_Users

I can not understand the logic of formulas in Data Studio. Not here standard functions like 'sumif' or 'where'.... only 'Case When'. But I can not put together a formula...

enter image description here

1
Can you share a sample report (w/o any real data) with editing permissions?kishkin

1 Answers

1
votes

It can be achieved by breaking down the formula into 2 Calculated Fields.

First :

CASE
  WHEN event_action= "manual_widget_click" THEN new_users
  ELSE 0
END

Then :

SUM(event_action= "manual_widget_click" THEN new_users) / Total_new_Users