Nesting aggregate functions in Librato

29 views Asked by At

I have 3 measures, and I want to add measure1 and measure2 and then subtract measure3 from the result. I'm unable to get the composite metric below to work. Any help would be appreciated.

subtract([
    sum([
        sum(s("measure1", "*")),
        sum(s("measure2", "*")),
    ]),
    sum(s("measure3", "*"))
])
1

There are 1 answers

0
Saurav On

Figured out what the issue was. Missing the aggregate function within the series.

subtract([
    sum([
        s("measure1", "*", {function:"sum"}),
        s("measure2", "*", {function:"sum"})
    ]),
    s("measure3", "*", {function:"sum"})
])