cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Alfredo
Engaged Sweeper

I just wanted to edit the widget mentioned in the title, so that it would only show me Windows device types and Monitors. After doing some research, I found that widgets (charts) are fed by Lansweeper's built-in reports, and I found the one I was looking for, called "Chart: Asset type summary." In it, I simply deactivated the "AssetTypename" field from the "tsysAssetTypes" table. After doing this, the main chart no longer shows the pie chart that used to display normally. However, the legend is still displayed correctly, showing the count of device types.

I didn't modify or alter the code; it was just that simple click on the "AssetTypename" field. But even after reactivating it, the widget never worked properly again. Curiously, if I edit the widget and change the type of report it shows, like "Asset manufacturer," the widget works properly again. Clearly, this must be because "Asset manufacturer" is pointing to a different report, which I haven't touched (and obviously don't want to).

Captura de pantalla 2024-10-17 183854.png

Captura de pantalla 2024-10-17 184104.png

The code is unaltered, so I can't understand why this mess happens :C

Select Top 1000000 Count(tblAssets.AssetID) As Total,
tsysAssetTypes.AssetTypename
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Where tblAssetCustom.State = 1 And tblAssets.Assettype <> 66
Group By tsysAssetTypes.AssetTypename
Order By Total Desc

1 ACCEPTED SOLUTION
Mister_Nobody
Honored Sweeper II
Select Top 1000000 tsysAssetTypes.AssetTypename,
  Count(tblAssets.AssetID) As Total
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Where tblAssetCustom.State = 1 And tblAssets.Assettype <> 66
Group By tsysAssetTypes.AssetTypename
Order By Total Desc

View solution in original post

2 REPLIES 2
Alfredo
Engaged Sweeper

Many many thanks!

You save my job 🙏

Captura de pantalla 2024-10-18 084523.png

Mister_Nobody
Honored Sweeper II
Select Top 1000000 tsysAssetTypes.AssetTypename,
  Count(tblAssets.AssetID) As Total
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Where tblAssetCustom.State = 1 And tblAssets.Assettype <> 66
Group By tsysAssetTypes.AssetTypename
Order By Total Desc