'Oracle Discoverer BI: how to use DECODE into a calculation with a SUM

Is it possible to use DECODE on a SUM field ? For example, something like this :

DECODE( SUM("QTA' CONV SUM 1 2 2"),'>0',1,'=0',0)


Solution 1:[1]

In your specific case, where you want the result to be 1 if the SUM is greater than zero or 0 if the SUM is zero, you can use the Oracle SIGN function. I'm not sure if there's any special Discoverer syntax, but outside of Discoverer I'd do it something like this:

SIGN(SUM(whatever you're summing))

The "techonthenet" site documents the function here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ed Gibbs