1 Reply Latest reply: Jan 2, 2018 11:52 AM by Sunny Talwar RSS

    Count with multiple conditions in the same dimension

    Wings Luo



      I want to count "number of shipments". The shipments could have N status codes (e.g. 'Picked-Up','Delivered' , etc.) - you might know from DHL or when you order something from the internet ;-)


      So my goal is to count shipments when they have specific status codes in our database.


      For example we have defined 6 status codes as mandatory, so we want to count all shipments in our database where ALL 6 statuses have been set. e.g.


      Shipments with status A: count(status = A... no of shipments) = 100


      Shipments with status B: count(status = B.. no of shipments) = 90


      Shipments with status A & B: count ???? = 80


      The question is, which formula I should use?


      I tried with the the "count" formula with comma, but could not have the correct number of shipments. Qliksense gave me the number of shipments with the last status in the formula


      count (status = A, status = B, ... no of shipments) = 90


      So I think the count formula cannot take me to my goal.


      Maybe someone here will have a better idea?