7 Replies Latest reply: Apr 23, 2018 7:05 AM by Sunny Talwar RSS

    Count if "Date is null" and Value=string/number

    Daniel Sørensen

      Hi

       

      So basically I have this data

       

      meter_iderror_codedeactivation_date

      123456

      2
      654654204-05-2017
      656565
      2131231Hardware_error
      2333333
      4444444Componet_error04-05-2017

       

      What I need to Count is an error_code=number

      count(distinct(if(error_code=2, deactivation_date=BLANK)))
      
      
      

       

      I only want to Count the Distinct meter_id, if the error_code=2, and the Distinct meter_id, has no deactivation_date

       

      What I need to Count is an error_code=string

      count(distinct(if(error_code='*Hardw*', deactivation_date=BLANK)))