3 Replies Latest reply on Jan 23, 2019 12:52 PM by Ali Bin Khalid

    Over Partition in Tableau

    Ali Bin Khalid

      Hi Guys,

      The Title of the discussion might seem a little bit off but I couldn't figure out to put my problem in better words. I have following data set:

         

      Emp. No.Emp. NameDepartmentCategory

      1A

      JamesA1
      2CJackC1
      3AJulietA1
      4BJulianB1
      5BJohnB2
      6CScottC2
      7CLauraC2
      8DAlexD2
      9EPeterE2
      10AMarkA3
      11AJohnsonA3

       

      where employees from same category may exist in more than one department.

       

      Problem Statement

      If employee number under any category contains the letter "B" then mark all the rows in that category as "B"

       

       

       

      Expected Output

      CateogryEmp. No. "New Calculated Field"
      11AB
      3AB
      4BB
      2CB
      25BB
      6CB
      7CB
      8DB
      9EB
      310ANull
      11ANull

       

      In the table above 'Expected Ouput' Under Category ID '1' there are four employee Numbers and one of them contains 'B' and hence the "New Calculated Field is populated with letter "B". Same goes for Category ID 2. However, Cateogry ID 3 has employee numbers containing only Letter "A" so "New Calculated Field" remains unmaked/Null.

       

      I have attached the dataset for convenience. Would greatly appreciate it if someone can help and attach the Tableau workbook with the table like expected output.