Conditional math expression in TSVB

Hello,

I am just curious if it would be possible to write a conditional statement inside the expression editor of the TSVB Math aggregation. For instance, consider I have an aggregation in TSVB metric which calculates an average of numbers. Then I create a new math aggregation, set the average equal to the "test" variable, and inside the Math expression editor I want to write something like:

if(params.test > 500){
   return add(300,params.test)
} else {
   return subtract(300,params.test)
}

Thanks.

Correct me if I'm wrong but looks like this would be possible using the "Bucket Script" aggregation in TSVB rather that the Math aggregation.

Still curious to know if the Math aggregation would support something like this.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.