Is there a way to use Math with a filter to one data metric and no filter to other data metric in OpenSearch dashboard?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue:



I’m trying to do the following.

Let’s say variable1 which is an integer and is coming from a data stream, has many Attribute Values such as attr1 and attr2. There is another variable, variable2 which is an integer and is coming from the same data stream. Now I want to take the sum of variable1 where the attr1=“some value1” and attr2=“some value2”. Then take the sum of variable2 without any filters/other filters. Then I want to show the division of these two results. Essentially, I’m trying to do sum_of_variable1_with_filters/ sum_of_variable2_without_filters. I can use Math aggregation and divide functions, but how do I apply filters just for the variable1 and not for variable2?

Is there a way to create the sum of variable1 and the sum of variable2 in different hidden series and use these in the Math function?

I’m trying to create a TSVB table from Dashboard->Visualization->Create.

Math can be used in the same data series, but applying filters is not restricted to one metric. Hence, I cannot do what I intended.