Are you trying that in the script, Can you show the result in the table chart, how does it look, left aligned or right aligned? to identify if Field2 is a text field or not..
If you are trying in the script, can you share the complete statement, is it like this?
if([Field1] = 'A',Field2*-1,Field2) AS Field2Negative