Skip to content

Commit 6f88f18

Browse files
Merge pull request #2740 from MicrosoftDocs/main638941357630981694sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 9d2335f + 3c3fc6e commit 6f88f18

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

data-explorer/kusto/query/mv-apply-operator.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,34 +217,34 @@ datatable (Val:int, Arr1:dynamic, Arr2:dynamic)
217217

218218
### Using `with_itemindex` for working with a subset of the array
219219

220-
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.
220+
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.
221221

222222
:::moniker range="azure-data-explorer"
223223
> [!div class="nextstepaction"]
224-
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAAzVOS27CMBDd5xRvU5FIRRC6rMwNOENkkoG4tT2WMyEJ4vCEQcziLeZ9PQmazoqFKbBetvFKmHHJHFBDGPUeg1BCrfwDwxiCze5O8CbYf2q8G6ScK5wXzCfuDjCr/wuH30KDiwfCbWtT8gsmJ33jhIKLHc1GEeQpUBTjX22yJOJL6TleK3CElpaKux16yoSFR/T2Rtiof4OW/RiiaiZVvHOPBj/6rNYJKfMftfKmvj+dT34iokT+AAAA" target="_blank">Run the query</a>
224+
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA02N2wrCMBBE3%2FMV89YGIrVeUCoV%2FI5SJLarDeRSStpa8OONEcF92IWZ2TmaPFrpJcp4vLxpQjq4uYCyXuAyDAXaxUqjGs4qhjBr8VPSai%2BQC2xrLqKV%2F1m7YIXoUeBQc1af2AfAXjDTSva9XjAr312VJ6NsS88ybkxSj1QGLLyDX3py91Q7%2B%2BBwFoGRRk6WoaOBsLgRnZwISfxO0Dg9Ghszc0x8W88lNkHkb%2BM%2FJCbvAAAA" target="_blank">Run the query</a>
225225
::: moniker-end
226226

227227
```kusto
228-
let _data =
229-
range x from 1 to 10 step 1
230-
| summarize l=make_list(x) by xMod2 = x % 2;
231-
_data
232-
| mv-apply with_itemindex=index element=l to typeof(long) on
233-
(
228+
let data = datatable (row: int, Arr: dynamic)
229+
[
230+
0, dynamic([5, 1, 3]),
231+
1, dynamic([4, 10, 8, 7])
232+
];
233+
data
234+
| mv-apply with_itemindex=index value=Arr to typeof(long) on
235+
(
234236
// here you have 'index' column
235-
where index >= 3
236-
)
237-
| project index, element
237+
where index >= 2
238+
)
238239
```
239240

240241
**Output**
241242

242-
| index | element |
243-
|--|--|
244-
| 3 | 7 |
245-
| 4 | 9 |
246-
| 3 | 8 |
247-
| 4 | 10 |
243+
| row | Arr | value | index |
244+
|--|--|--|--|
245+
| 0 | [5, 1, 3] | 3 | 2 |
246+
| 1 | [4, 10, 8, 7] | 8 | 2 |
247+
| 1 | [4, 10, 8, 7] | 7 | 3 |
248248

249249
### Using multiple columns to join element of two arrays
250250

0 commit comments

Comments
 (0)