Hi all,
I had a request to filter the NCM Report called "Physical Entities (Serial Number) v2" by a defined Custom Property.
After a few tests I managed to tweak the existing SWQL query to add the ability to filter by a Custom Property.
For this example the Custom Property is called "Owner".
I added two lines to the SWQL, they are:
1- LEFT JOIN Orion.NodesCustomProperties as NCP ON OrionNodes.NodeID=NCP.NodeID
2- AND NCP.Owner='EMEA'
This lines will go right before the WHERE clause (1) and at the end (2). The query should look something like:
(...)
LEFT JOIN NCM.EntityPhysical AS NcmEntityPhysical ON NcmEntityPhysical.NodeID=NcmNodeProperties.NodeID AND NcmEntityPhysical.EntityClass=3
LEFT JOIN Orion.NodesCustomProperties as NCP ON OrionNodes.NodeID=NCP.NodeID
WHERE OrionNodes.Vendor='Cisco'
AND NCP.Owner='EMEA'
If necessary you can keep adding Custom Properties by copying the last line and adding to the end and change the "Owner" to the name of the desire Custom Property.
Hope this one helps someone 
BR,
Ricardo Morais