cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Level 8

Using PIVOT function on table with Node Custom Pollers

Hello,

I am trying to take a table I have filled with custom poller stats, and pivot it so the CustomPoller Description rows become the columns:

what it looks like now:

cameljake_0-1585157059546.png

What I'm trying to get it to look like:

cameljake_1-1585157318624.png

Here's the statement so far without the pivot table:

SELECT top 100 cpa.CustomPollerName as PollerName, cps.Status, cpa.CustomPollerDescription
FROM Orion.Nodes N
INNER JOIN Orion.NPM.CustomPollerAssignment CPA ON N.NodeID=CPA.NodeID
FULL JOIN Orion.NPM.CustomPollerStatistics CPS ON CPS.CustomPollerAssignmentID=CPA.CustomPollerAssignmentID
INNER JOIN Orion.NodesCustomProperties CP ON CP.NodeID= N.NodeID
Where N.Caption = '{node name goes here}' and
Group by cpa.CustomPollerName, cps.Status, cpa.CustomPollerID, cpa.CustomPollerDescription

Some of the poller names are are turning duplicate values but I plan on cleaning that up with a datetime statement later.

If anyone can assist with pivoting this table it would be super helpful.

 

Tags (2)
0 Kudos