3 Replies Latest reply on Aug 9, 2018 11:52 PM by lei.chen.0

How can I find out Employee's First three month sales from their start date?

Hello Friends,

I am relatively new to Tableau and I have a requirement to find out the total sales for the first 3 months of the employees (almost 10,000 employees) starting from the start date.

I have two tables, Employee and Transaction. Both tables have a common field (Employee ID).

My requirement is employees join on different dates, so how can i calculate sales for each of them since their start date.

All help is appreciated.

Thank you

* Cannot share data as it contains sensitive information.*

• 1. Re: How can I find out Employee's First three month sales from their start date?

Hello Thiraj,

I suppose your tables and fields look like this.

Table: Employee

[EmployeeID]

[StartDate]

[EndDate]

Table: Transaction

[EmplyeeID]

[SalesAmount]

[SalesDate]

Left join Table: Employee with Table: Transaction on field [EmployeeID]

And use this calculation,

SUM(IIF(DATEDIFF('month', [StartDate],[SalesDate])<=3, [SalesAmount], 0))

Regards

Lei

1 of 1 people found this helpful
• 2. Re: How can I find out Employee's First three month sales from their start date?

Hi Lei,

Thank you for your answer. I made a few changes to the data set thinking it would be a bit more easier. Currently I have one data set which has the following details:

- Employee start date

- Transactions done by employee

- Date of the transactions

I just need to get the COUNT of all the transactions for the first 3 months of the employee's start date.

Thank you,

Appreciate it so much!

• 3. Re: How can I find out Employee's First three month sales from their start date?

Hello Thiraj,

Just simply change [SalesAmount] to 1, and you'll get the COUNT

SUM(IIF(DATEDIFF('month', [StartDate],[SalesDate])<=3, 1, 0))

Regards

Lei

1 of 1 people found this helpful