4 Replies Latest reply on Oct 10, 2018 6:51 AM by Matías Merino

# Count the difference of dates

Hi,

I have a little problem with count the differences of "Dates". For this i have this example:

I have this data:

 ID Date 1 01/07/2018 1 02/07/2018 1 03/07/2018 1 03/07/2018 2 01/07/2018 2 01/07/2018

I need to have how many differences of dates have every ID.

 ID Differences Dates by ID 1 2 2 0

Thanks a lot,

Greetings.

• ###### 1. Re: Count the difference of dates

Hi Merino,

Create Calculation field as below :

{fixed [ID]: (MAX([Date]) - MIN([Date]))}

Regards,

• ###### 2. Re: Count the difference of dates

Thanks for the help, but this is not what I need.

I need to count how many different dates are in every ID, no how many days

are between the minimum and maximum dates.

Thanks for the help :).

Greetings.

El mar., 9 de oct. de 2018 19:15, Padma Yalavarthi <

tableaucommunity@tableau.com> escribió:

Tableau Community Forums

Count the difference of dates

in Forums - View the full discussion

• ###### 3. Re: Count the difference of dates

Matias- Padma's solution aligns with your question and screenshot though?

If all you need is just distinct dates for an ID will this work?

Actually, there are 3 distinct dates associated with ID = 1, I don't know how you got 2 in the screenshot. However, If there is only 1 distinct date my calc would assign it as 0 instead.

Hope this helps.

Best,

Shiva.

• ###### 4. Re: Count the difference of dates

Thanks,

That's is almost the answer, but the answer is more basic than that , and you help me to realized that

i just need a COUNTD(Dimension).

Thanks you very much for the help!, have a super week

Greetings.