Traffic lights in a data table

I want to traffic light a numeric column in a data table, this I could easily do by using the color segments mode and setting the threshold values for green,yellow, red (green less than 5, yellow between 5 and 6 and red greater than 6).

However my logic is not that simple - I need to take into account values from another column which contains the strings '=','<' or '>'. If the numeric value has a '<' in the other column then the traffic light color should be green, '>' should mean it's red and if it it's '=' then it should obey the value thresholds.

Is this possible? at each segment point I can see that I can add a custom expression but I'm not sure what that would look like.

Many thanks


(1) Answer