Hi, I am trying to make a saved search taking max ...
# general
n
Hi, I am trying to make a saved search taking max quantity on hand of an item and subtracting out item receipts within a certain time frame, based off of this suite-answers https://netsuite.custhelp.com/app/answers/detail/a_id/75940/kw/inventory%20aging. I basically want to take total on hand inventory - item receipts for the first 30 days, then 60 days then 61-90 etc. I am trying to use a case statement regarding that , but when I use a case statement like "Case when max({item.quantityonhand}) - (case when Trunc({today}) - {trandate} < 30 then {quantity} else 0 end) < 1000 then 777 else 888 end" I get an error from NetSuite, but if I use a case statement like "Case when max({item.quantityonhand}) - 1000 < 1000 then 777 else 888 end" it works. Am I missing something that is obviously wrong with the first one?