How Does one convert Bytes to MB/Gb in SWQL Table Widgets?
Hi im quite new into the SWQL space,
i have created a new modern dashboard and im making use of widgets using custom and graphical query builder "SWQL" , im getting all the information from interface displayed correct about traffic but its all in bytes and i cannot see how to covert this ....
can anyone help on how this is done ?
Any help on this would be great thanks again 
Regards
Brad
This is my SWQL, is there anyway to covert the bytes to MB
SELECT TOP 10 n.FullName,aggSub1._avg AS Orion_NPM_InterfaceTraffic_InTotalBytes_avg,aggSub2._avg AS Orion_NPM_InterfaceTraffic_OutTotalBytes_avg,aggSub3._avg AS Orion_NPM_InterfaceTraffic_InMaxbps_avg,aggSub4._avg AS Orion_NPM_InterfaceTraffic_OutMaxbps_avg,aggSub5._avg AS Orion_NPM_InterfaceTraffic_InAveragebps_avg,aggSub6._avg AS Orion_NPM_InterfaceTraffic_OutAveragebps_avg,aggSub7._max AS Orion_NPM_InterfaceTraffic_ObservationTimestamp_max
FROM Orion.NPM.Interfaces n
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.InTotalBytes) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:35.151Z' AND '2022-05-05T14:15:35.151Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub1 ON aggSub1.InterfaceID=n.InterfaceID AND aggSub1.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.OutTotalBytes) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:38.270Z' AND '2022-05-05T14:15:38.270Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub2 ON aggSub2.InterfaceID=n.InterfaceID AND aggSub2.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.InMaxbps) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:40.798Z' AND '2022-05-05T14:15:40.798Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub3 ON aggSub3.InterfaceID=n.InterfaceID AND aggSub3.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.OutMaxbps) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:43.438Z' AND '2022-05-05T14:15:43.438Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub4 ON aggSub4.InterfaceID=n.InterfaceID AND aggSub4.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.InAveragebps) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:46.790Z' AND '2022-05-05T14:15:46.790Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub5 ON aggSub5.InterfaceID=n.InterfaceID AND aggSub5.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, avg(i.OutAveragebps) AS _avg FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:49.750Z' AND '2022-05-05T14:15:49.750Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub6 ON aggSub6.InterfaceID=n.InterfaceID AND aggSub6.InstanceSiteId=n.InstanceSiteId
LEFT JOIN (
SELECT i.InterfaceID,i.InstanceSiteId
, max(i.ObservationTimestamp) AS _max FROM Orion.NPM.InterfaceTraffic i
WHERE (i.DateTime BETWEEN '2022-05-04T14:15:52.744Z' AND '2022-05-05T14:15:52.744Z') GROUP BY i.InterfaceID,i.InstanceSiteId
) aggSub7 ON aggSub7.InterfaceID=n.InterfaceID AND aggSub7.InstanceSiteId=n.InstanceSiteId
WHERE (FullName = 'InterfaceName')