2 Replies Latest reply on May 15, 2018 8:36 AM by Jenni Davila

    Count of Distinct IDs based on value of a string variable

    Jenni Davila

      Hello Tableau Community,

       

      I'm struggling with the following task and would appreciate any help available. I have a table (represented below) with IDs and a variable that has several different string values possible. I need to count the distinct IDs (COUNTD) WHEN the value of the string variable equals either 1 of 2 values, but doesn't equal the other values.

       

      So for the example table below, I would want a count of distinct IDs when Variable1 equals yellow or green. The result should be 3 (2 yellow, 2 green, but green has the same ID so isn't counted again). I attached the example table as a packaged workbook.

       

        

      IDVariable1
      abcyellow
      abc1green
      abc2yellow
      abc3red
      abc1green
      abc4red

       

      Thank you in advance!