This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have 2 fields in my data - "Amount" & "Indicator". Amount has all positive numbers (e.g. 3.2, 0.1, 10 etc.). Indicator has either "credit" or "debit" in it. I need to write an if condition so that the values in the amount field get converted to negative number if the indicator is "credit" and remains positive otherwise.
I tried a code like this
IF [indicator]= "credit" THEN [amount] = (-1)*[amount] ELSE [amount]=[amount] ENDIF
but this returns me 0 for all debit values and -1 for all credit values. Any suggestions on how to do it correctly?