Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Sum function not working as expected in SWQL

$
0
0
I suspect that the problem may be that the timestamps actually include milleseconds

 

You are absolutely correct. When grouping by just the raw date time, the grouping is going to be done by the internally stored value for the datetime, which is accurate to 100 nanoseconds, which makes it virtually impossible to have more than one row for any given datetime value.

 

If grouping by minute is sufficient, you may be able to use the DateTrunc() function:

 

SELECT DateTrunc('minute',IT.DateTime), SUM(InAveragebps) AS InAveragebps, SUM(OutAveragebps) AS OutAveragebps, I.CustomProperties.ASIC

FROM Orion.NPM.InterfaceTraffic IT

INNER JOIN Orion.NPM.Interfaces I ON IT.InterfaceID = I.InterfaceID

INNER JOIN Orion.Nodes N ON I.NodeID = N.NodeID

WHERE N.NodeID = ${NodeID} AND I.CustomProperties.ASIC IS NOT NULL

GROUP BY DateTrunc('minute',IT.DateTime), I.CustomProperties.ASIC


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>