I have a field with values > = != etc., and another field that determines threshold
Now I want to Compare the value of third field against the threshold field using the value of that (String) operator. How to achieve this?
for example:
Threshold (Num)|Value(Num)|Operator(String)
10|12|">"
10|7|"!="
10|4|"<"
I need to compare the values using respective operator values and determine if the threshold is breached.
Any clue?
How about a big case statement which writes an expression for every possible operator (should be a finite list), like this
your current search with fields Threshold, Value, Operator
| eval isBreached=case(Operator=">" AND Value>Threshold, "Yes", Operator="!=" AND Value!=Threshold,"Yes", Operator="<" AND Value<Threshold,"Yes", true(),"No") | rest of the search
How about a big case statement which writes an expression for every possible operator (should be a finite list), like this
your current search with fields Threshold, Value, Operator
| eval isBreached=case(Operator=">" AND Value>Threshold, "Yes", Operator="!=" AND Value!=Threshold,"Yes", Operator="<" AND Value<Threshold,"Yes", true(),"No") | rest of the search
Awesome. Thanks a million @somesoni2. This helps a lot 🙂
Really Appreciate this.