2 Replies Latest reply on Mar 30, 2018 10:10 AM by Ashish Sharma

# Date difference Calculation

Hi,

Please assist me with the previous day or yesterday's count tableau calculation as well as the percentage change.

For instance, consider that there's a task allocated to any specific Agent and that task has one 'Task Allocated Date, Task Start Date and Task Complete Date. I need to understand as to how I can find the 'Count difference' between Previous day and Current day('Task Allocated Date, Task Start Date and Task Complete Date) as well as the percentage change.

Thank you so much for your time!!

• ###### 1. Re: Date difference Calculation

`Hi Ashish, not sureI fully understand your question but I will offer the following:`

` `

`If you want thenumber of days between two dates and the dates you are comparing are indifferent fields you can simply use the DATEDIFF() with this syntax:`

` `

`DATEDIFF(‘day’, [`Task Allocated Date`], [`Task Start Date`]) `

` `

`If the dates youare comparing are in the same field, this link provides a nice explanationabout how to determine the difference between them by comparing them both to athird reference date like 1/1/1900.`

` `

http://kb.tableau.com/articles/howto/calculate-difference-in-dates-with-one-date-field

I’m afraid I don’t know what you mean by “percentage
change.”

provide clarification on your data structure and what you mean by percentage
change with regard to dates.

2 of 2 people found this helpful
• ###### 2. Re: Date difference Calculation

Hi Wendy,

Thank you so much for your response!

I'll try to reframe the question.

For instance, There's an employee with a name Jack. He has been assigned with few tasks on 03/28/2018 and 03/29/2018.

Jack                           03/28/2018                                                     03/29/2018

(Day Before Yesterday)                            (Previous day/Yesterday)

Total Count                    10                                                                      20

I've been trying to figure out the calculation for the difference between the total count of tasks completed for Yesterday and Day before Yesterday.

With that I need to understand the "Relative change in the Percentage" for Yesterday and Day before Yesterday.