Video Screencast Help
Endpoint Management Community Blog

How to Create a Report for the Results of a Filter, in Order to Save as CSV

Created: 22 Mar 2013 • Updated: 22 Mar 2013 • 1 comment
dcudney's picture
0 0 Votes
Login to vote

I was wanting to save the results of a filter to an Excel file today, and I found that the filter did not have a "Save As" button. I found an article here that explained it, but I modified the report slightly to fit my needs. I was looking for way to get the list of computers in my Patch Test Group Filter. I used this SQL query to create a report to then save as a .csv:

 

SELECT Distinct 

r.Guid AS '_ItemGuid', 

r.Name AS 'Resource', 

r.[User], 

r.[System Type], 

r.[OS Name], 

vItem.Name AS FilterName

FROM 

vItem INNER JOIN

CollectionMembership INNER JOIN

vComputerEx AS r ON CollectionMembership.ResourceGuid = r.Guid ON 

vItem.Guid = CollectionMembership.CollectionGuid LEFT OUTER JOIN

Inv_AeX_AC_Identification ON r.Guid = Inv_AeX_AC_Identification._ResourceGuid

WHERE

CollectionMembership.CollectionGuid = 'd0fae853-3129-490f-86fd-e8a8bc0162f2'

ORDER BY r.Name ASC

All you need to change on this report os the Guid for your required Filter (in the SQL its called a collection still...). You can get the guid of your Filter by right clicking on your desired Filter, and click on "Properties". This will give you the guid to put in this SQL query.

 

Comments 1 CommentJump to latest comment

bbertoch's picture

This was exactly what I needed. Although I added a report perameter for the guid so that I would not have to edit the report everytime I needed to check a different filter. I also created one for user based filters too, I just had to change vComputerEX to vUser and remove r.[User, r.[System Type], and r.[OS Name]. Thanks for this acticle it saved me a lot of time figuring out the query on my own!

0
Login to vote