COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: mc09 on 18 Jun 2009 05:52:39 AM

Title: don't calculate zero value
Post by: mc09 on 18 Jun 2009 05:52:39 AM
hi 
how can i implement below
table A
col1 col2 col3 col4 col5
1     AA   10    10   10
2     AA    20   10    0
3     AA    0     10    0
i want to this show report as
col2  col3  col4  col5
AA    15    10     10
-----
Title: Re: don't calculate zero value
Post by: Gopinath on 18 Jun 2009 07:52:02 AM
Try using the following expression in Col3, Col4, Col5


Total([column] for Report) / Total( if ([column] <> 0) Then (1) else (0))
Title: Re: don't calculate zero value
Post by: uttam.mistry on 18 Jun 2009 03:37:14 PM
or
use average(if col = 0 then NULL else col end)