SYMPTOM
A user tries to create a custom filter expression in Strategy Desktop 8.1.x and 9.x using the ApplyLogic function, as illustrated below. The expression parser fails to validate the expression, with a message under the expression editor reading "Invalid Expression."

Sql
ApplyLogic ( "#0 > #1 AND #2 > #3", Year@ID, 2003, Month@ID, 200301)
CAUSE
The usage of ApplyLogic is incorrect in this case.
ApplyLogic takes a list of arguments, where the first is a string providing the SQL syntax to pass through to the database and the remaining arguments are Boolean expressions. In the above example, the Boolean comparison operators are written into the string, and the function arguments are attribute forms and integer constants, which cannot be converted into true or false Boolean values.
The above expression should be rewritten as follows to validate successfully.

Sql
ApplyLogic ( "#0 AND #1", Year@ID > 2003, Month@ID > 200301)
Another issue remains, however. After clicking OK to save the expression into the filter, the SQL string is replaced by a single comma. The resulting filter cannot be evaluated by Strategy SQL Generation Engine.

ACTION
The issue of the incorrect expression saved into the filter definition has been logged for review by Strategy Engineering. Contact Strategy Technical Support for an update on the status of this issue.
WORKAROUND
The expression may be rewritten to use ApplyComparison instead.

Sql
ApplyComparison( "#0 > #1 AND #2 > #3", Year@ID, 2003, Month@ID, 200301)