Skip to main content
Announcements
Qlik Cloud maintenance is scheduled for this weekend May 11-12. View maintenance windows per region here.

Tenant Admin cannot delete datasets for unknown / deleted user

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Seanog_Murphy
Creator III
Creator III

Tenant Admin cannot delete datasets for unknown / deleted user

Last Update:

May 10, 2022 3:14:14 PM

Updated By:

Jamie_Gregory

Created date:

Mar 18, 2022 5:09:08 AM

In the current release of Qlik Sense SaaS, it is not possible for the TenantAdmin to delete a dataset in the personal space of another user. Even if this user is deleted, the dataset remains visible in the catalog overview.

There is a plan to introduce this functionality, however in the meantime you can use the CLI as a workaround.

The command to list all data sets is:
qlik item ls --resourceType=dataset

Then you need to get the dataset ID. If you navigate to the details tab for the dataset, you can see the dataset ID in the URL, or it can also be found in the output in the command above.

The command to delete the dataset is:
qlik item rm 'datasetID'


Below is a PowerShell script that wraps qlik-cli to delete all datasets that are owned by "unknown" users. This may be helpful In the case where there are several datasets left behind by one or more deleted users.

$userIds = & qlik user ls -q
$allDatasets = qlik item ls --resourceType=dataset | ConvertFrom-Json
$unknownUserDatasets = $allDatasets | Where-Object ownerId -notin $userIds
if ($unknownUserDatasets.Length -gt 0) {
Write-Host "There are $($unknownUserDatasets.Length) out of $($allDatasets.Length) datasets listed below that are owned by unknown users."
$unknownUserDatasets | Format-Table id,name
$confirm = Read-Host "Remove them? (Type 'yes' and press Enter to confirm)"

if ($confirm -eq "yes") {
$unknownUserDatasets | ForEach-Object {
qlik item rm $_.id | Out-Default
}
Write-Host "Done."
} else {
Write-Host "Canceled by user."
}
} else {
Write-Host "All datasets belong to a user."
}

Sample Output

 

>.\Remove-UnknownUserDatasets.ps1
There are 3 out of 7 datasets listed above that are owned by unknown users.
id                       name
--                       ----
6239ee9e2e8d05b64a85b871 results3.xlsx
6239ee9eaaf2ba86d765eea5 results2.csv
6239ee9ecfa32f179de16270 results.csv

Remove them? (Type 'yes' and press Enter to confirm): yes
Done.
>.\Remove-UnknownUserDatasets.ps1
All datasets belong to a user.
>
 

Environment

  • Qlik SaaS

 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Related Content 

https://qlik.dev/libraries-and-tools/qlik-cli

Version history
Last update:
‎2022-05-10 03:14 PM
Updated by: