Hello,
I am fighting with SWQL/SQL query for few hours now and I feel like I reached a dead end. Maybe you could point me in the right direction? 
I need to combine UnDP statistics with its labels. I was able to do that with using Custom Poller ID and Row ID. Timestamps are working fine.
The query is working in SQL Management Studio (SQL) as well as in SWQL Studio (SWQL). It is even working on Custom Table, but for some reason, Custom Chart is displaying "Error".
For Custom Chart, I tried to use daydiff as well as ${FromTime}, but both did not resolve the issue.
This is NPM 12.5 (upgraded from fresh installation of NPM 12.4).
I even tried to include a dummy column in "Group chart data by", as suggested in one of the technical article, but this does not help.
SQL:
---------------------------
SELECT
cpsd.DateTime
,cpsd.RawStatus as [vSConns]
--cpsd.Status,
--,n.Caption
,labels.Label
FROM CustomPollerStatistics cpsd
JOIN CustomPollerAssignment cpa ON cpsd.CustomPollerAssignmentID = cpa.CustomPollerAssignmentID
JOIN CustomPollers cp ON cpa.CustomPollerID = cp.CustomPollerID
JOIN Nodes n ON cpa.NodeID = n.NodeID
JOIN CustomPollerLabels labels ON
(cpsd.RowID = labels.RowID AND cpsd.CustomPollerAssignmentID = labels.CustomPollerAssignmentID)
WHERE cp.UniqueName = 'vSConns' --AND daydiff(cpsd.DateTime,getdate())<1 --and cpsd.DateTime > ${FromTime}
--GROUP BY cpsd.DateTime,cpsd.RawStatus,n.caption , cpsd.Status, labels.Label
GROUP BY cpsd.DateTime, cpsd.RawStatus, labels.Label --, n.Caption
ORDER BY cpsd.RawStatus desc
SWQL:
---------------------------
SELECT
cpsd.DateTime
,cpsd.RawStatus as [vSConns]
--cpsd.Status,
--n.Caption,
,labels.Label
FROM Orion.NPM.CustomPollerStatistics cpsd
JOIN Orion.NPM.CustomPollerAssignment cpa ON cpsd.CustomPollerAssignmentID = cpa.CustomPollerAssignmentID
JOIN Orion.NPM.CustomPollers cp ON cpa.CustomPollerID = cp.CustomPollerID
--INNER JOIN Orion.[Nodes] n ON cpa.NodeID = n.NodeID
JOIN Orion.NPM.CustomPollerLabels labels ON
(cpsd.RowID = labels.RowID AND cpsd.CustomPollerAssignmentID = labels.CustomPollerAssignmentID)
WHERE cp.UniqueName = 'vSConns' AND daydiff(cpsd.DateTime,getdate())<1 --datetime < ${FromTime}
--GROUP BY cpsd.DateTime,cpsd.RawStatus,n.caption , cpsd.Status, labels.Label
GROUP BY cpsd.DateTime, cpsd.RawStatus, labels.Label
--ORDER BY n.caption
Screenshot:
From SolarWinds website:

From SWQL Studio:

Thanks,
Marcin.