Can we add or subtract series from two different measurements?

I have to calculate total capacity remaining for nodes. I am using subquery to get the sum of last values of two values separately - total usage and total capacity into two new different measurements. Would it be able to calculate difference from these two measurements ? or can this be done from single query ?

Calculating total capcaity -
select sum(last) into “tier0_total_total” from (SELECT last(“value”) FROM “ofstat_value” WHERE “type_instance” = ‘tier0_total’ and host=~ /.*/ and instance = ‘null’ GROUP BY host)

calculating total usage-
select sum(last) into “tier0_inuse_total” from (SELECT last(“value”) FROM “ofstat_value” WHERE “type_instance” = ‘tier0_inuse’ and host=~ /.*/ and instance = ‘null’ GROUP BY host)

Now I need to find the difference from these two measurements “tier0_total_total”, “tier0_inuse_total”.
Any help is appreciated

@arevur91 Have you tried to structure this as a Continuous Query? Try having both CQs (one for each of those queries) write into the same measurement. Also I would remove the host=~/.*/ from those queries. That just matches everything.