As the title says, I'm having an issue with nesting a case statement in a Netsuite saved search. Found plenty of examples on here and around the web, but I cannot seem to get it right. Basically I'm trying to make a report for our CFO that will show the taxable amount of certain orders. The first thing I check is if the customer is tax exempt or not. If they are, I want 0.00 to show. If they are not, I check to see if the order has already been taxed and remove that amount from the order total and display the difference. If none of these are true (customer is taxable and tax has not been charged) display the order total.
I've tried multiple ways of nesting, but the way that seems to work for most people is something like this:
CASE WHEN {customermain.taxable} = 'F' THEN '0.00' WHEN {netamountnotax} > 0 THEN {totalamount}-({totalamount}-{netamountnotax}) ELSE {totalamount} END When I run this as a Formula (Text), the field displays an error, "ERROR: Invalid Expression". When I use it as Formula (Currency), the whole search errors out.
I thought that it might be because I was outputting text, so I single quoted what the result should be, but that caused the search to error out as well.
I know I'm messing up somewhere, but I cannot find it and am hoping another pair of eyes will see my mistake.