1 Reply Latest reply on Apr 6, 2018 11:20 AM by Eric Hammond

    Date and week numbers

    Ramyata Mehrotra

      I have a problem that I am trying to solve.

      There are multiple employees with different hire dates. We have some performance metrics for employees. Now I am building a dashboard to check how the employee performed in their first four weeks or six weeks or eight. This number can change.


      Week1 for employee A would be different from Week1 of employee B cause their weeks start when they get hired.


      So is their way to calculate week number for this scenario. Tableau gives me week based on when it falls in the calendar whereas I want the weeks to start for each employee on their individual hi QQre dates.


      The idea is when business changes the number of weeks they want to see, I just have to change the number instead of making a big change.

        • 1. Re: Date and week numbers
          Eric Hammond

          Hi Ramyata,


          Create a calculated field, [WeekNum]:

          'Week ' + STR(DATEDIFF('week',[Date Hired],[Date Field])). 


          Right-click on this calculated field and choose "Show Filter" to change the number of weeks. 

          Depending on the data structure, date hired may be in a different record.  A level-of-detail calculation can be used to reference it. For example:

          [Date Hired] = {Fixed [EmployeeID] : MIN(IF [Event] = 'Hired' THEN [Date Field] END )}