title: Find sum of engagement_time_msec for users who have done an event named "yt_event" in BigQuery
body: <p>My table looks like this:</p>
  <p><a href="https://i.stack.imgur.com/5aca9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5aca9.png" alt="enter image description here" /></a></p>
  <p>There's one more column named &quot;user_pseudo_id&quot; which is unique id for users. I want to take sum of event_params.key = 'engagement_time_msec' for user_pseudo_id who have done event_name = 'yt_event'.</p>
  <p>Also, event_params.key = 'engagement_time_msec' is only present in two events only, i.e. event_name = 'user_engagement' and 'screen_view'.</p>
  <p>I have tried subqueries like this:</p>
  <pre><code>SELECT
  user_pseudo_id,
  (
  select
  sum(value.int_value/60000)
  from unnest(event_params)
  where
  key = 'engagement_time_msec'
  and
  user_pseudo_id = 'yt_users') as eng_time_min
  FROM
    `Xyz.events_20201030`
  where
  event_name = 'yt_event'
  </code></pre>
  <p>But I am not able to get it.</p>
  <p>Please help me. I will be highly obliged.</p>
  <p>Thanks.</p>