You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Using `with_itemindex` for working with a subset of the array
219
219
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.
221
221
222
222
:::moniker range="azure-data-explorer"
223
223
> [!div class="nextstepaction"]
224
-
> <ahref="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAAzVOS27CMBDd5xRvU5FIRRC6rMwNOENkkoG4tT2WMyEJ4vCEQcziLeZ9PQmazoqFKbBetvFKmHHJHFBDGPUeg1BCrfwDwxiCze5O8CbYf2q8G6ScK5wXzCfuDjCr/wuH30KDiwfCbWtT8gsmJ33jhIKLHc1GEeQpUBTjX22yJOJL6TleK3CElpaKux16yoSFR/T2Rtiof4OW/RiiaiZVvHOPBj/6rNYJKfMftfKmvj+dT34iokT+AAAA"target="_blank">Run the query</a>
224
+
> <ahref="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA02N2wrCMBBE3%2FMV89YGIrVeUCoV%2FI5SJLarDeRSStpa8OONEcF92IWZ2TmaPFrpJcp4vLxpQjq4uYCyXuAyDAXaxUqjGs4qhjBr8VPSai%2BQC2xrLqKV%2F1m7YIXoUeBQc1af2AfAXjDTSva9XjAr312VJ6NsS88ybkxSj1QGLLyDX3py91Q7%2B%2BBwFoGRRk6WoaOBsLgRnZwISfxO0Dg9Ghszc0x8W88lNkHkb%2BM%2FJCbvAAAA"target="_blank">Run the query</a>
225
225
::: moniker-end
226
226
227
227
```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
+
(
234
236
// here you have 'index' column
235
-
where index >= 3
236
-
)
237
-
| project index, element
237
+
where index >= 2
238
+
)
238
239
```
239
240
240
241
**Output**
241
242
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 |
248
248
249
249
### Using multiple columns to join element of two arrays
0 commit comments