1 Reply Latest reply: Feb 15, 2011 12:25 PM by Nick Borunov RSS

    Set with Null values

      Hi,

      I've a "Maintenances" table with 2 fields: FailureType and MaintenacesCount.
      I wuold like to count all the maintenances where FailureType is null.
      I'm using the expression below, which works correctly:

      sum(MaintenancesCount) - sum({<FailureType={*}>}MaintenancesCount)

      As you see, I get what I need subtracting 2 sets.
      Is there a way to describe a set of null values? Something like this (which doesnt work)

      sum({<FailureType={null}>}MaintenanceCount)

      Regards,
      Corrado

       

        • Set with Null values

          You can replace NULL value by the string value - "NULLFailureType"

           


          LOAD
          ....
          if(isNull(FailureType, 'NULLFailureType', FailureType)) as FailureType
          ....


          After that you can use your expression:

           


          sum({<FailureType={"NULLFailureType"}>}MaintenanceCount)