This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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.