diff --git a/data-explorer/kusto/query/mv-apply-operator.md b/data-explorer/kusto/query/mv-apply-operator.md index fb90a29639..741d0fcbba 100644 --- a/data-explorer/kusto/query/mv-apply-operator.md +++ b/data-explorer/kusto/query/mv-apply-operator.md @@ -217,34 +217,34 @@ datatable (Val:int, Arr1:dynamic, Arr2:dynamic) ### Using `with_itemindex` for working with a subset of the array -The query results in a table with rows where the index is 3 or greater, including the index and element values from the original lists of even and odd numbers. +The query results in a table with rows where the index is 2 or greater, including the index and element values from the original lists. :::moniker range="azure-data-explorer" > [!div class="nextstepaction"] -> Run the query +> Run the query ::: moniker-end ```kusto -let _data = - range x from 1 to 10 step 1 - | summarize l=make_list(x) by xMod2 = x % 2; -_data -| mv-apply with_itemindex=index element=l to typeof(long) on - ( +let data = datatable (row: int, Arr: dynamic) +[ + 0, dynamic([5, 1, 3]), + 1, dynamic([4, 10, 8, 7]) +]; +data +| mv-apply with_itemindex=index value=Arr to typeof(long) on + ( // here you have 'index' column - where index >= 3 - ) -| project index, element + where index >= 2 + ) ``` **Output** -| index | element | -|--|--| -| 3 | 7 | -| 4 | 9 | -| 3 | 8 | -| 4 | 10 | +| row | Arr | value | index | +|--|--|--|--| +| 0 | [5, 1, 3] | 3 | 2 | +| 1 | [4, 10, 8, 7] | 8 | 2 | +| 1 | [4, 10, 8, 7] | 7 | 3 | ### Using multiple columns to join element of two arrays