# set\_difference

```
let RequiredApps = toscalar (datatable (AppName: string) [
 "1Password",
 "Camtasia 2021",
 "Azure Monitor Agent"
]
| summarize  make_set(AppName));
AppInventory_CL
| where TimeGenerated > ago (7d)
| summarize arg_max(TimeGenerated, *) by ManagedDeviceID_g, AppName_s
| summarize  InstalledApps = make_set(AppName_s) by ManagedDeviceID_g, ComputerName_s
| extend  MissingApps= set_difference(RequiredApps, InstalledApps)
| where MissingApps <> '[]'
| project ComputerName_s, MissingApps
```

<figure><img src="https://3533425259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbx8yn20QqNJtsVaH9CY7%2Fuploads%2FFdKOVRvayNwnN6HARKCf%2Fimage.png?alt=media&#x26;token=8f890634-cf0d-4a34-8300-261fc749af49" alt=""><figcaption></figcaption></figure>
