Troubleshooting SRL errors

The SRL syntax errors are displayed when PolyAnalyst cannot determine the syntax of your query. In case of an error, you will see a pop-up message indicating the row and column (the number of characters from the beginning of the line, including spaces) where the error occurred.

For example:

2 > 2 will return "no".

Let’s show the incorrect use of the operator:

2 :> 2 will return an error.

This expression will result in error as there is no :> operator in SRL. In this case, you will see a message like this:

This expression is neither SRL nor PDL expression, errors are:

SRL: line 1 col 3: syntax error at ":>" missing { % "<end of expression>" operator "xor" "and" "or" "," ")" }

PDL: line 1 col 1: syntax error at "2" missing { "!" "false" "true" "yes" "mod" "no" string identifier number }

Note that PolyAnalyst tracks both the SRL and PDL syntax. See here about using PDL inside SRL expressions.

Where PolyAnalyst begins having a problem with a syntax error is not always where the actual error occurs. For example, if we type the column name [My Column] but omit the ending bracket, PolyAnalyst may report that the error starts at the beginning bracket (because an ending bracket was not found).

Here is a brief list of some other SRL errors:

  • invalid use of whitespace (remember to separate certain operators from values by at least one space);

  • invalid use of brackets when naming a column;

  • typing a literal value but not using quotes correctly;

  • forgetting a parenthesis, or adding an extra parenthesis when working with functions;

  • typing the name of a function incorrectly;

  • adding an extra comma or missing a comma when specifying arguments for a function;

  • invalid use of an operator (like 1 + or 1 + + 2).

Troubleshooting "column not found" errors

This error is seen when you reference the name of a column in your expression, but that column could not be found in the list of existing columns in the dataset. Perhaps you mistyped the column name, or misspelled it, or there is no such column.

Troubleshooting "wrong number of arguments" errors

This error is displayed when using the wrong number of arguments for a function.

For example, the abs() function takes one argument. If you pass in two arguments, like abs(3, 4), then the function will result in error.

Note that this error frequently occurs because you forgot to use a comma somewhere in an expression, or because you added in an extra comma somewhere in the expression, e.g. the abs(3,) query will result in error.

Troubleshooting "arguments types mismatch" errors

This error is displayed when PolyAnalyst is evaluating the use of a function inside the expression, and evaluates its arguments, and determines that the data type of one or more of the arguments is incorrect.

The abs() function in SRL takes a number and returns the absolute value of the number.

If you pass a Date/time or a Boolean or a String value instead of a Number, the function will result in error.