If I remember correctly, tableau extracts with a calculated field in will perform the calculation upon extract and act like the calculated field is part of the data.
This might explain why you are seeing a null if there are null values in the fields you are using.
Do you have instances of this that have a value other than 0, if so are you seeing the same issue for these? Also, are there any levels of aggregation set for the extract?
If it is only instances of 0 this is happening for you could use zn() around the fields to make sure it doesn't bring a null in. If not I would suggest speaking to tableau support, unless anyone else on here has more details.
Thanks for your comment Chris.
Yes, there are instances where the calculation is different than zero, and they work fine. The problem is only when the result is zero because there are no record that satisfy the criteria (status not C nor D)
Unfortunately the ZN() you suggest wouldn't work in my case because what I actually need to know is when the result is NULL or zero:
If there are not records that satisfy the criteria the I need NULL If there are records that satisfy it, then I need to get the result of the SUM... and this SUM could very well be zero or any other value.
We try hard to make all functions work the same on all databases, but there are cases where the database won't do what we want.
I checked the Oracle documentation and it seems to say that this case should work.
I tried to reproduce your problem and could not get the 0 behavior you see.
So we'd need more details to see if there was anything we could change about this.