title: Getting number of rows using Left Join kql? Function 'row_number' cannot be invoked in current context. Details: the row set must be serialized
body: <p>I have the following query:</p>
  <pre><code>let p1 = pageViews | where url has &quot;xxx&quot;;
  p1
  | join kind=inner (pageViews 
          | where  url !has &quot;xxx&quot;)
  on session_Id
  | project timestamp1, session_Id1, url1, client_CountryOrRegion1, client_StateOrProvince1, client_City1, user_Id1 
  </code></pre>
  <p>It does get users that originated from a certain provider and then looks at which URLs they are going to.</p>
  <p>I am now trying to get how many users I got from that provider.</p>
  <p>I could just do <code>distinct session_Id</code> and <code>count</code> but what I would like to do is add two columns, first for specific session_id and then increment it when it changes and another one to increment for the number of requests made.</p>
  <p>i.e</p>
  <p><a href="https://i.stack.imgur.com/CTjub.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CTjub.png" alt="enter image description here" /></a></p>
  <p>I <a href="https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/rownumberfunction" rel="nofollow noreferrer">tried</a>:</p>
  <pre><code> let p1 = pageViews | where url has &quot;project-management&quot;;
  p1
  | join kind=inner (pageViews 
          | where  url !has &quot;project-management&quot;)
  on session_Id
  | project timestamp1, session_Id1, url1, client_CountryOrRegion1, client_StateOrProvince1, client_City1, user_Id1 
  | extend Rank=row_number(1) 
  </code></pre>
  <p>but it gave me</p>
  <blockquote>
  <p>Function 'row_number' cannot be invoked in current context. Details: the row set must be serialized</p>
  </blockquote>