5 Replies Latest reply on Aug 16, 2016 9:14 AM by Sevil Marandi

    Counting unique responses based on date field

    Sevil Marandi

      In the table below (showing dummy data), I need to count the number of Patient IDs in a given status. If a patient ID is associated with more than one status code, then I'd like to count only the status code most recently assigned to that patient. Any help on how I go could achieve this in Tableau would be much appreciated.

        

      Status CodeDatePatient ID
      Pending1/1/20161
      Active2/1/20161
      Discontinued5/23/20162
      None6/12/20163
      Pending8/10/20163
      Active6/12/20164
      Discontinued3/15/20165
      None1/1/20166

       

      Expected result:

      Status CodeCount of Patient ID(s)
      Pending1
      Active2
      Discontinued2
      None1

       

      Thanks,

      SM