15 Replies Latest reply: Feb 26, 2018 2:54 PM by Wanyun Yang RSS

    Handle NULL in calculation.

    Wanyun Yang

      Hi guys,

       

      Here's what my raw data looks like:

      Capture.PNG

      Order A is divided into sub orders a,b,NULL. I want to calculate the net sales of A, which should be 2+3+4=9. I wrote this formula in Qlik Sense:

      SUM(Netsales)/COUNT(DISTINCT SubOrders)

       

      But the result is NULL. How can I fix this?

       

      Thanks for help!