Order of > or < in expression


#1

I am writing an expression that will show me the value of IndoorTemperature only when OutdoorTemperature is greater than 50.

  1. (OutdoorTemperature > 50) ? IndoorTemperature : null
  2. (50 < OutdoorTemperature) ? IndoorTemperature : null

Is there a reason the second expression would throw an error while the first one evaluates correctly?
If there is a reason where would I have been able to find documentation explaining why I was wrong in the second example.


#2

What error do you get?


#3

I’m guessing the expression engine parser is expecting a field name on the left side of the operator. Technically there is nothing wrong with the second example, but if the parser is not specifically built to handle that, it will throw an error.


#4

The parser should be handling the expression. Can you please provide the exact exception? That will help us narrow down the root cause


#5

The exact expression I had was essentially 50 < mySimpleMetric ? 1: 0 where mySimpleMetric was a valid expression.