Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
borgoncete88
Engaged Sweeper III

Hi all,

Just created a new custom report that works fine where if the two conditions are true paint the rows on green and if one of them is not true paint the row red. So at this point, I need to only show on the report the red rows. Is that difficult? This is the code in SQL:

Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName As NOMBRE,
tblAssets.Lastseen As [ULT. VISTO],
tblAssets.Username As [ULT. USUARIO LOGADO],
tblAssetCustom.Custom5 As [USUARIO ASIGNADO],
tblAssetCustom.Custom4 As [FECHA ASIGNACIÓN],
tblAssetCustom.Department As DPTO,
tblAssetCustom.Building As PLANTA,
tsysOS.OSname As OS,
tblAssets.Version As [VERSION OS],
tblBaseBoard.Manufacturer As MARCA,
tblAssetCustom.Model As MODELO,
tblAntivirus.DisplayName As ANTIVIRUS,
tblSoftware.softwareVersion As VERSIÓN,
tblAntivirus.productUpToDate As [¿ACTUALIZADO?],
Case
When tblAssets.Version = '22H2' And tblAntivirus.productUpToDate = 'True'
Then '#d4f4be'
Else '#ffadad'
End As backgroundcolor
From tblAssets
Left Join tblBaseBoard On tblAssets.AssetID = tblBaseBoard.AssetID
Left Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblPhysicalMemory On tblAssets.AssetID = tblPhysicalMemory.AssetID
Inner Join TsysMemorytypes On tblPhysicalMemory.MemoryType =
TsysMemorytypes.Memorytype
Inner Join tblVideoController On
tblAssets.AssetID = tblVideoController.AssetID
Inner Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID And
tblAntivirus.AssetID = tblSoftware.AssetID
Where tblAntivirus.DisplayName != 'Windows Defender' And
tblAntivirus.DisplayName != 'ESET Security' And tblSoftware.CatalogSoftwareId
= 741
Order By NOMBRE

Kind regards!!

 

1 ACCEPTED SOLUTION

Hi @Mister_Nobody,

I tried your solution and worked well, but I realised that filtering by case I already have, using the color code '#ffadad' as criteria, works exactly the same way and I don't need to create an additional column. 

So thank you for the clue. I was  very helpful.

Greetings!

View solution in original post

3 REPLIES 3
Mercedes_O
Currently Away

Nice work @Mister_Nobody  and for sharing workaround @borgoncete88 

Mister_Nobody
Honored Sweeper II

 

Case
When tblAssets.Version = '22H2' And tblAntivirus.productUpToDate = 'True'
Then 'no-RED'
Else 'RED'
End As STATUS

 

Add column and filter by it

Hi @Mister_Nobody,

I tried your solution and worked well, but I realised that filtering by case I already have, using the color code '#ffadad' as criteria, works exactly the same way and I don't need to create an additional column. 

So thank you for the clue. I was  very helpful.

Greetings!

Reports & Analytics

Ask about reports you're interested in and share reports you've created. Subscribe to receive daily updates of reports shared in the Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now