Doing math on two different sets of documents is not supported in TSVB, with one exception: if you want to divide, then there is the metric called "Filter Ratio" which accepts two filters. If you just want to display the count of two different sets of documents, you can split by the Filters aggregation.
The most flexible query-building tool we have is Vega, but it's much harder to use than TSVB. You may want to look into it.