The set is calculated once for the entire chart, not per row, i.e. per order number. You'll need an if statement instead.
And you have nulls in your data. Those can cause your expressions to return nulls too. See this selection:
The Quantity column contains nulls because you didn't specify an aggregation function. Therefore the only() function is used and that returns null if there is more than only value. OldQty has nulls for some order numbers so null is returned for those orders. OCD also contains nulls for some orders.
Can you explain what the correct results should be and why?