Your sample query represents that your looking for the same data(index and type) and comparing.In that case no need to use subsearch.. below query should help you.
index=main type=test
| eval totalUsage=upper(mvindex(split(usage,"."),0))
| eval used_memory = round(current_memory/total_memory * 100, 2) ]
| table index used_memory total_memory
In case you are looking from two different data sets where you require to have a common field to correlate and that common field should be part of table in the subsearch.
... View more