When editing a Security Rule in the QMC in Qlik Sense 2.x, users may see a strange error message when they click Apply or Validate rule.
An error occurred
Unexpected token & in JSON at position
Restart QMC / Cancel
The error is caused by an invalid character in the text box.
It may be hard to find this character though. Take the text out of the Conditions text box and paste it into Notepad. See if any of the characters look odd there. Look for fancier or augmented characters like left and right handed versions of double and single quotes. These will render as plain quotes in the Conditions text box but will be rejected during rule validation.
A visual example for double quotes:
" ascii dec = 34, hex = 0x22
“ unicode = U+201C, “
” unicode = U+201D, ”
Using services like:
... will not work.
Best solution is to upgrade to Sense 2.2.4 or Sense 3.0 as the error will say "Illegal character found(”)". This bug was most likely fixed along with this bug: QLIK-35025
This problem is still present in Sense 2.0.9 and older on the 2.0.x branch.