CASE WHEN formula not working?
This formula works by itself - (CASE WHEN {type} IN 'Non-inventory Item' THEN NVL({custitem_ev_uk}, 0) - NVL({custitem_bun}, 0) ELSE 0 END)
however am getting blanks for the same bit in the formula:
CASE WHEN {type} IN 'Non-inventory Item' THEN NVL({custitem_ev_uk}, 0) - NVL({custitem_bun}, 0) ELSE 0 END + ((CASE WHEN {type} IN ('Assembly', 'Inventory Item') AND {inventorylocation} = 'ABC' THEN {locationquantityavailable} ELSE 0 END + CASE WHEN {type} IN ('Assembly', 'Inventory Item') AND {inventorylocation} = 'XYZ' THEN {locationquantityavailable} ELSE 0 END) - (CASE WHEN {inventorylocation} = 'ABC' AND {locationquantityavailable} > 0 THEN 1 ELSE 0 END + CASE WHEN {inventorylocation} = 'XYZ' AND {locationquantityavailable} > 0 THEN 1 ELSE 0 END) * (CASE WHEN (CASE WHEN {type} IN ('Assembly', 'Inventory Item') AND {inventorylocation} = 'ABC' THEN {locationquantityavailable} ELSE 0 END > 0) AND (CASE WHEN {type} IN ('Assembly', 'Inventory Item') AND {inventorylocation} = 'XYZ' THEN {locationquantityavailable} ELSE 0 END > 0) THEN {custitem_buffer} / 2 ELSE {custitem_buffer} END))
Any ideas where's it wrong?