Hi @brainiac,
Sorry for the miss read. In that case you are looking for a join on the tag:
import "sampledata"
t1 = sampledata.float()
|> mean()
t2 = sampledata.float()
join(
tables: {t1: t1, t2: t2},
on: ["tag"],
)
|> map(fn: (r) => ({ r with _value: r._value_t2 - r._value_t1 }))
|> yield(name: "custom-name")