Hello Erik, thanks for your reply but the problem is not with the single quotes. That value is just an example, but I did further tests with all kinds of value, and what I concluded is this: ApplyPatches is not working on ANY MEASURE DEFINITION in the hypercube. I can apply patches correctly on other properties of the hypercube, but as soon as I try on a property inside one of the measures, no matter if it's a string, number or boolean value, I get that error. Also note that I already tried using "replace" instead of "2" (the two should be equivalent tho)
Thanks again for your support, really appreciated.
As it turns out, something must've gone wrong with my Qlik Sense. After rebooting the server ApplyPatches started working again, even with the single quotes, like this:
(note that the single quotes were INSIDE of the string in the last line of my first post, so they should've worked... in yours they didn't because you tried to escape the single quotes, instead of the double quotes, which is indeed a syntax error )