title: How do I access outer column in subquery in kusto / Azure application insights?
body: <p>I am trying to simply run a subquery in Azure application insights, using Kusto, so that I can get some information from two tables displayed as one. </p>
  
  <p>The query I'm trying is</p>
  
  <pre><code>table1
  | extend progressLog = toscalar(
      table2 
      | where common_Id == table1.common_Id // errors saying Ensure that expression: table1.common_Id is indeed a simple name
      | summarize makelist(stringColumn) 
  )
  </code></pre>
  
  <p>I have attempted to alias this id, and even join the two tables, as such:</p>
  
  <pre><code>requests
  | extend aliased_id = common_Id
  | join traces on operation_Id, $left.operation_Id == $right.operation_Id
  | extend test_id = operation_Id 
  | extend progressLog = toscalar(
      traces 
      | where operation_Id == aliased_id // Failed to resolve column or scalar expression named 'aliased_id'
      | summarize makelist(message) 
  )
  </code></pre>
  
  <p>Failed to resolve column or scalar expression named 'aliased_id'.</p>
  
  <p>I am simply trying to do the equivalent of the T-SQL query:</p>
  
  <pre><code>SELECT 
      ... ,
      STRING_AGG(table2.stringColumn, ',')
  FROM
      table1 
  INNER JOIN 
      table2 
      ON table1.common_Id = table2.common_Id
  GROUP BY 
      table.&lt;props&gt;
  </code></pre>
  
  <p>My main question is - how do I reference "common_Id" in the kusto language inside a subquery</p>