The expression is always a comparison. The comparison operator is within XML one of (.ne., .eq., .gt., .ge., .lt., .le.). Each variable has to be a single word without spaces. Mathematical symbols or functions like e, pi or cos cannot be used as variableId, but they will be interpreted mathematically. Note that in case one of the variables of the expression contains missing values for a timestep, the expression fails, and no flags will be altered for this timestep. Also manually edited flags will be left untouched. In 2012_01 and onwards, it is possible to use logical conditions in the expression. These can be in Fortran77 style .and. and .or. or with && and ||.
For instance, when using the following expression, the flags for a timeseries will overridden with the specified flag if the specified flag is less reliable than the current flag and the value a is absolute difference with b is bigger than 10 or a is less than 1000.
(abs(a - b) .gt. 10) .or. a .lt. 1000
Some mathematical functions worth mentioning are the following (these must be in lowercase):