1 Reply Latest reply on Mar 30, 2016 6:01 PM by Alex Blakemore

    Help with a count

    Sarah Crilley

      I feel like this should be somewhat easy and I KNOW I'VE DONE IT BEFORE but I can't get it work with this particular spreadsheet and I'm stuck.


      What I'm working with:  HR Data.  Hire dates and term dates.  The data looks like this:




      And I want to put it into Tableau and have it show me, by month, the count of how many people were hired and how many were termed.


      This is, however, what I get:


      Bar Graph.JPG


      I've done these before where I ask it for a count, and it works, but for some reason it's lumping the hire date and term date together and no matter what I do I get this type of data.  Is it because I have two date fields?  I don't know.  Any help would be appreciated!

      Thank you in advance!

        • 1. Re: Help with a count
          Alex Blakemore

          There are many ways to go with this depending on the analytical question you are trying to address.


          Yes, analysis becomes complex when you have multiple date fields and you ask a question that involves treating them as one. It helps to have a clear idea of what each row in your data set represents (an individual?, an HR action?). Different questions will work better with differently shaped data sets. It is natural to ask questions about counting people when your data set has one row per person, for example, but it can be messy to ask questions about counting HR actions of the same dataset.


          Here is a workbook that addresses (what I think is) your question using Tableau 9.3's UNION feature, to reshape your data to have one row for each HR action instead of one row for each individual. You can get a similar effect by reshaping the data in advance before feeding it to Tableau.


          Sheet 1.png


          Sometimes it helps to have two Tableau data sources that point to the same database but that show the data at different levels of granularity or shaped differently. Then you can use the datasource most natural for the view you want to create, rather than trying to have one mother-of-all-datasources that you use for every problem.

          1 of 1 people found this helpful