Annoying Saved Search formula which has been bugging me all week, and probably now been staring at it too long to be able to see the solution! Need to run Saved Search which indicates whether Location A has enough stock to cover back orders in Location B - I can get the search to work fine, but struggling to get the final element which is basically saying "Does Location B have enough stock to cover Location A order" I can calculate the quantity available, but not whether this is enough. Here's what I'm working with.
MAX(CASE WHEN {inventorylocation.id} = 2 THEN {locationquantityavailable} END) - MAX(CASE WHEN {inventorylocation.id} = 9 THEN {locationquantitybackordered} END)
That works fine, and tells me the qty left, however I need to know that this isn't less than zero, and so have tried this.
CASE WHEN (MAX(CASE WHEN {inventorylocation.id} = 2 THEN {locationquantityavailable} END) - MAX(CASE WHEN {inventorylocation.id} = 9 THEN {locationquantitybackordered} END)) > 0 THEN 'Yes' ELSE 'No' END
But this just errors. Any suggestions?