Are you sure the problem is in replace function?
I just tried with a replace as your and I didn't get any error.
Also I've seen you have some other table alias in your code (bold) s, m, c but the table are missing.
replace(t.tpc_subject, ',',' '),
FROM tpc t WITH(NOLOCK);
It's always great to get hold of the actual error message text.
BTW the QlikView scripting engine puts everything between (SQL) SELECT and the semicolon as-is in a packet buffer and sends it unparsed to the Relational Database. It would be weird for QlikView instead of the RDBMS parser to return an error for bad SQL syntax...