title: How to select very first non-null date BigQuery
body: <p>I want to select very first non-null datetime but it doesn't work for me with using</p>
  <blockquote>
  <p>&quot;row_number() over partition()&quot;</p>
  </blockquote>
  <p>In my code now I just excluded null rows and now I need to select only the lowest date.
  Pls.help how to fix it:</p>
  <pre><code>left join (
            select deal, type, assigned_to_user, marked_as_done_time,
            first_value(marked_as_done_time ignore nulls) over (partition by deal
            order by marked_as_done_time asc ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) as first_value,
            
            from data_marts.pipedrive_activity
            where done = 'Done' 
            group by 1,2,3,4
            ) act on act.deal = d.id
  </code></pre>