I have created this first beastmode calc, and it seems to work just fine.
Case when `Total On Hand` - SUM(CASE when `Planned Shipment Date` < (CURDATE()+ 21) then `Outstanding Quantity` else 0 end) < 0 then `Item No` else 0 end
When I add a COUNT(DISTINCT to the end, it does not work and gives me the classic "An issue has occurred during processing. We..." error.
COUNT(DISTINCT Case when `Total On Hand` - SUM(CASE when `Planned Shipment Date` < (CURDATE()+ 21) then `Outstanding Quantity` else 0 end) < 0 then `Item No` else 0 end)
I would have expected it to work. Anybody have any suggestions?
Thanks