Substract metric values

Hi Team,

Grafana: 4.2.0, Elasticsearch 5.5.0, Graph panel…
I’ve two numeric fields in Elasticsearch index (let’s assume FieldA, FieldB). FieldA is strictly graphed as avg, and i need to graph FieldB, but substracted with FieldA. So i need two metrics in fact:
FieldA
FieldB - FieldA
Is it possible somehow ? For example using Metric->Script ? Or in another way ?

Thanks in advance !

This should help: Basic Elastic Search Query

I swear i tried it yesterday and didn’t work…I have tried moment ago, and…works fine.
Magic touch? :slight_smile:

Thanks a lot daniellee !