The requirement is to display zero or nothing when the value in a cell negative?
Asked
Active
Viewed 345 times
2 Answers
0
It's simple- try a CASE
construct.
SELECT CASE
WHEN myColumn < 0 THEN 0 -- or NULL
ELSE myColumn
END AS myColumnAlias
FROM myTable
WHERE <myConditions>

Rachcha
- 8,486
- 8
- 48
- 70
0
A couple years late. Hope you already figured it out.
As for your question, I believe the only solution would be to create a business rule/calc script that would check all existing data and overwrite negative values with 0. Please make sure:
- use dense dimension member on the left side of the equation to ensure the performance and not create unnecessary blocks.
- turn
FRMLBOTTOMUP ON
; since you only execute this calculation on existing data so it is safe and faster to use this command.

lovechillcool
- 762
- 2
- 10
- 32