title: KQL: mv-expand OR bag_unpack equivalent command to convert a list to multiple columns
body: <p>According to <a href="https://docs.microsoft.com/en-us/azure/kusto/query/mvexpandoperator" rel="nofollow noreferrer">mv-expand documentation</a>:</p>
  <blockquote>
  <p>Expands multi-value array or property bag.</p>
  <p>mv-expand is applied on a dynamic-typed column so that each value in the collection gets a separate row. All the other columns in an expanded row are duplicated.</p>
  </blockquote>
  <p>Just like the mv-expand operator will create a row each for the elements in the list -- Is there an equivalent operator/way to make each element in a list an additional column?</p>
  <p>I checked the documentation and found <a href="https://docs.microsoft.com/en-us/azure/kusto/query/bag-unpackplugin" rel="nofollow noreferrer">Bag_Unpack</a>:</p>
  <blockquote>
  <p>The bag_unpack plugin unpacks a single column of type dynamic by treating each property bag top-level slot as a column.</p>
  </blockquote>
  <p>However, it doesn't seem to work on the list, and rather works on top-level JSON property.</p>
  <p>Using bag_unpack (<em>like the below query</em>):</p>
  <pre><code>datatable(d:dynamic)
  [
      dynamic({&quot;Name&quot;: &quot;John&quot;, &quot;Age&quot;:20}),
      dynamic({&quot;Name&quot;: &quot;Dave&quot;, &quot;Age&quot;:40}),
      dynamic({&quot;Name&quot;: &quot;Smitha&quot;, &quot;Age&quot;:30}),
  ]
  | evaluate bag_unpack(d)
  </code></pre>
  <p>It will do the following:</p>
  <pre><code>Name    Age
  John    20
  Dave    40
  Smitha  30
  </code></pre>
  <p>Is there a command/way (see <code>some_command_which_helps</code>) I can achieve the following (<em>convert a list to columns</em>):</p>
  <pre><code>datatable(d:dynamic)
  [
      dynamic([&quot;John&quot;, &quot;Dave&quot;])
  ]
  | evaluate some_command_which_helps(d)
  
  </code></pre>
  <p>That translates to something like:</p>
  <pre><code>Col1    Col2
  John    Dave
  </code></pre>
  <p>Is there an equivalent where I can convert a list/array to multiple columns?</p>
  <p>For reference: We can run the above queries online on <a href="https://portal.azure.com/#blade/Microsoft_Azure_Monitoring_Logs/DemoLogsBlade" rel="nofollow noreferrer">Log Analytics</a> in the demo section if needed (<em>however, it may require login</em>).</p>