Saurav
Saurav

Reputation: 1

Nesting aggregate functions in Librato

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", "*"))
])

Upvotes: 0

Views: 26

Answers (1)

Saurav
Saurav

Reputation: 1

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"})
])

Upvotes: 0

Related Questions