Arithmetic operations on metric sets

is it possible to do some calculations on metrics with different sets of fields using flux?
I’ll try to explain with example. For three series:
x=“xtag1,xtag2,xfield1,xfield2,…,xfieldN”
y=“ytag1,ytag2,ytag3,yfield1,…,yfieldN”
z=“ztag1,…ztagN,zfield1,…,zfieldN”
I need a graph showing
(sum(xfield1,…,xfieldN) - sum(yfield1,…yfieldN)) / sum(zfield1,…zfieldN)
grouped by some common tag(s)
May be this can be done using some additional calculated fields ?