Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

QoQ division with zero

$
0
0

Hi All,

I have an issue with QoQ when the division is zero. I usually use nullif in oracle queries but it is not allow in QoQ.

How can I go around this issue?

Code example:

<cfquery name="qrySum" dbtype="query">

            select 'Item01' as DESCR

            <cfloop from="2011" to="2016" index="y">

                ,sum(FY_#y#)     as FY_#y#

                ,sum(COST_#y#) as COST_#y#

                ,sum(COST_#y#) / sum(FY_#y#) as PERC_#y#

            </cfloop>

            from qryItems

            group by DESCR

        </cfquery>

where for a year 2014 the sum(FY) = 0  and sum(COST)= 0

Thanks,

 

Johnny


Viewing all articles
Browse latest Browse all 5979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>