1

I am trying to write a fixed calculation in tableau to get the minimum start date of employee when there is a change in Subteam. Attached a screenshot to give you an idea of what I am trying to do. It has my current result and expected result as well. Any help would be appreciated.

Thank youTableau Data

AnilGoyal
  • 25,297
  • 4
  • 27
  • 45
  • You will need another variable to be able to do what you are trying to, like a start date for team AI, if they change then ML will have a start date, change back to AI, will have a new start date. If they change twice like in your last 2 lines AI, AI, the start date will be same – Jonathan Lam Mar 01 '21 at 10:09
  • 1
    @rajesh, actually Tableau is not good at data restructuring/modification. In tableau, a new field has to be generated, for this. This can be easily done in any programming tool like R, etc. – AnilGoyal Mar 01 '21 at 10:36

1 Answers1

1

Starting with this sample input (I added a second employee):

Date        Emp ID  Team
29/02/2020  1234    AI
31/03/2020  1234    AI
30/04/2020  1234    ML
31/05/2020  1234    AI
30/06/2020  1234    AI
01/01/2020  567     AI
01/04/2020  567     ML
01/07/2020  567     AI
01/08/2020  567     AI

You can approach the problem using "previous" records, using LookUp function, based on EmpId and Team:

LOOKUP(MAX(str([Emp ID])+[Team]),-1)

Now you need to filter just rows where this conditions is true:

min(STR([Emp ID])+[Team]) != ifnull([LookUp],'XXX')

The output could look like the following: enter image description here

Fabio Fantoni
  • 3,077
  • 3
  • 22
  • 32