3 Replies Latest reply on Jun 21, 2016 10:55 PM by Nicholas Twort

    Countif Bar chart

    Nicholas Twort

      Hi there,

       

      I've got a column in my data that says which people were involved in a particular task (one task per row)

       

      e.g.

      DayTask IDPeople
      1/1/2016123Matt
      2/1/2016124Matt, Sarah, James

       

      I want to plot a bar chart with a bar for each person and height the number of tasks (rows) they appear in.

       

      So from the above example we should have bars of height 2 for Matt,  1 for Sarah, and 1 for James.

       

      There is only a small number of people who will ever be listed. I tried creating both calculated fields and sets but still couldn't display it how I wanted.

       

      Any suggestions would be appreciated.

        • 1. Re: Countif Bar chart
          Mark Fraser

          Hi Nicholas

           

          Is reshaping your data an option? (note the source data, I have 1 per person per task, per day)

          I presume you want something like this?

          Cheers

          Mark

          1 of 1 people found this helpful
          • 2. Re: Countif Bar chart
            Mahfooj Khan

            The only way I can think of right now is, to perform the split on your original data source and then copy all the data and paste it on a new excel workbook. Bring the data back in Tableau and do a pivot on the splits:

            Split

            Copy data in excel

            again conect excel data in tableau and pivot

            Delete unwanted columns

            Rename the Pivot field values to "People" and put data source filter to ignore null values.

            Final view of data

            Your output

            Although this is not the best way to do it because if the data changes at the source level, you will have to re-do this process. If there is however, a one time need to show the data the way you described, this might just work fine. Try to transpose your data at source level first. like the screen shot (final view of data).

            workbook (version 9.2) attached for your reference.

             

             

            Mahfooj

            2 of 2 people found this helpful
            • 3. Re: Countif Bar chart
              Nicholas Twort

              I was really hoping not to have to reshape the data but it looks like its going to be the easiest way.

               

              Thanks for the help everyone