Multiple hosts in same query

For the query below, Query Inspector yields the following:
error:"fill(none) must be used with a function"

Ultimately, we have 3 gateways. We’ve recently switched one gateway for another, but there’s data in the old that we’d like to keep. In this graph, I’m graphing these individually, but I’d like to reverse the Y-Axis with the sum of the individuals.

Instead of my tearing my hair out, is this possible, and does anyone see where I went wrong?
(Also, when I switch to fill(null) I get this error:
error:"GROUP BY requires at least one aggregate function"

My query below:
SELECT (“SITE1-OLD-Calls” + “SITE2-Calls” + “SITE1-NEW-Calls”)
AS “TOTAL-SIP-CALLS”
FROM (
SELECT last(“out-dial-peer-1”) + last(“out-dial-peer-3”)
AS “SITE1-OLD-Calls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.1’) AND $timeFilter
),(
SELECT last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-13”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-101”) + last(“out-dial-peer-102”) + last(“out-dial-peer-103”) + last(“out-dial-peer-104”) + last(“out-dial-peer-105”) + last(“out-dial-peer-106”) + last(“out-dial-peer-107”) + last(“out-dial-peer-120”) + last(“out-dial-peer-121”)
AS “SITE2-Calls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.2’) AND $timeFilter
),(
SELECT last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-102”) + last(“out-dial-peer-104”) + last(“out-dial-peer-106”) + last(“out-dial-peer-120”)
AS “SITE1-NEW-Calls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.3’) AND timeFilter ) GROUP BY time(__interval) fill(none)

Query Inspector shows valid data, but it doesn’t display correctly with the following query. (No GROUP BY)

SELECT "ActiveCalls"
FROM (
	SELECT last("out-dial-peer-1") + last("out-dial-peer-3")  
        AS "ActiveCalls" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x.1') AND $timeFilter 
),(
	SELECT last("out-dial-peer-10") + last("out-dial-peer-12") + last("out-dial-peer-13") + last("out-dial-peer-16") + last("out-dial-peer-100") + last("out-dial-peer-101") + last("out-dial-peer-102") + last("out-dial-peer-103") + last("out-dial-peer-104") + last("out-dial-peer-105") + last("out-dial-peer-106") + last("out-dial-peer-107") +  last("out-dial-peer-120") + last("out-dial-peer-121") 
        AS "ActiveCalls" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x2') AND $timeFilter 
),(
	SELECT last("out-dial-peer-10") + last("out-dial-peer-12")  + last("out-dial-peer-16") + last("out-dial-peer-100") + last("out-dial-peer-102")  + last("out-dial-peer-104")  + last("out-dial-peer-106")  +  last("out-dial-peer-120")  
        AS "ActiveCalls" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x3') AND $timeFilter 
)

Could you try this?

SELECT SUM("ActiveCalls1" + "ActiveCalls2" + "ActiveCalls3")
FROM (
	SELECT last("out-dial-peer-1") + last("out-dial-peer-3")  
        AS "ActiveCalls1" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x.1') AND $timeFilter 
),(
	SELECT last("out-dial-peer-10") + last("out-dial-peer-12") + last("out-dial-peer-13") + last("out-dial-peer-16") + last("out-dial-peer-100") + last("out-dial-peer-101") + last("out-dial-peer-102") + last("out-dial-peer-103") + last("out-dial-peer-104") + last("out-dial-peer-105") + last("out-dial-peer-106") + last("out-dial-peer-107") +  last("out-dial-peer-120") + last("out-dial-peer-121") 
        AS "ActiveCalls2" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x2') AND $timeFilter 
),(
	SELECT last("out-dial-peer-10") + last("out-dial-peer-12")  + last("out-dial-peer-16") + last("out-dial-peer-100") + last("out-dial-peer-102")  + last("out-dial-peer-104")  + last("out-dial-peer-106")  +  last("out-dial-peer-120")  
        AS "ActiveCalls3" 
        FROM "autogen"."VOIP" 
        WHERE ("agent_host" = 'x.x.x3') AND $timeFilter 
) 
GROUP BY time(__interval) fill(none)

I get the error below from the query …further below:
error:"fill(none) must be used with a function"

SELECT (“ActiveCalls1 + ActiveCalls2 + ActiveCalls3”)
FROM (
SELECT (last(“out-dial-peer-1”) + last(“out-dial-peer-3”) )
AS “ActiveCalls1”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.1’) AND $timeFilter
),(
SELECT (last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-13”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-101”) + last(“out-dial-peer-102”) + last(“out-dial-peer-103”) + last(“out-dial-peer-104”) + last(“out-dial-peer-105”) + last(“out-dial-peer-106”) + last(“out-dial-peer-107”) + last(“out-dial-peer-120”) + last(“out-dial-peer-121”))
AS “ActiveCalls2”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.2’) AND $timeFilter
),(
SELECT (last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-102”) + last(“out-dial-peer-104”) + last(“out-dial-peer-106”) + last(“out-dial-peer-120”) )
AS “ActiveCalls3”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.3’) AND timeFilter ) GROUP BY time(__interval) fill(none)

This worked:

SELECT (sum(“ActiveCalls”))
FROM (
SELECT (last(“out-dial-peer-1”) + last(“out-dial-peer-3”) )
AS “ActiveCalls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.1’) AND $timeFilter
), (
SELECT (last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-13”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-101”) + last(“out-dial-peer-102”) + last(“out-dial-peer-103”) + last(“out-dial-peer-104”) + last(“out-dial-peer-105”) + last(“out-dial-peer-106”) + last(“out-dial-peer-107”) + last(“out-dial-peer-120”) + last(“out-dial-peer-121”) )
AS “ActiveCalls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.2’) AND $timeFilter
), (
SELECT (last(“out-dial-peer-10”) + last(“out-dial-peer-12”) + last(“out-dial-peer-16”) + last(“out-dial-peer-100”) + last(“out-dial-peer-102”) + last(“out-dial-peer-104”) + last(“out-dial-peer-106”) + last(“out-dial-peer-120”) )
AS “ActiveCalls”
FROM “autogen”.“VOIP”
WHERE (“agent_host” = ‘x.x.x.3’) AND timeFilter )GROUP BY time(__interval) fill(none)

Great!

What did you do?

Adding “(…)” ?

SELECT (sum(“ActiveCalls”))

and

GROUP BY time(__interval) fill(none)