> For the complete documentation index, see [llms.txt](https://sandyzeng.gitbook.io/kql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandyzeng.gitbook.io/kql/kql-quick-guide/my-favorites/summarize/take_any.md).

# take\_any

**take\_any** will return a random row from the dataset

### Return only one random row

```
IntuneDevices
| summarize take_any(*)
```

![](https://3533425259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbx8yn20QqNJtsVaH9CY7%2Fuploads%2FnyKJ6mfDhfRlgjvS0sc5%2Fimage.png?alt=media\&token=a5f44201-047a-44d5-bee7-85fca5ec5200)

### Return only one random row with specific columns

```
IntuneDevices
| summarize take_any(DeviceName, TimeGenerated, DeviceId)
```

![](https://3533425259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbx8yn20QqNJtsVaH9CY7%2Fuploads%2F37gnlzNRavgBcPuz0eus%2Fimage.png?alt=media\&token=126f01c9-288b-4397-a685-24808e249af9)

### Use with by, returns a random row for each distinct value from that column

```
IntuneDevices
| summarize take_any(DeviceId, OS, CompliantState) by DeviceName
```

![](https://3533425259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbx8yn20QqNJtsVaH9CY7%2Fuploads%2FOcaWItpFneCyeXMA66m3%2Fimage.png?alt=media\&token=28effa73-b13b-4d7d-8e3b-e9331d9fd883)
