Skip to main content

Hi,

I have a dataset with dates in this format: dd/mm/yyyy hh:nn:ss. I want to calculate the number of minutes between consecutive timestamps using DATEDIFF('minute', LOOKUP(ATTR([Date (3)]),-1),LOOKUP(ATTR([Date (3)]),0)).

 

Whenever there is a change of day this is not calculated correctly. It seems as though Tableau mixes days and months. Yet, the dates are in the correct format, and when using

DATEPART('day', LOOKUP(ATTR([Date (3)]),0))

or DATEPART('month', LOOKUP(ATTR([Date (3)]),0))

or other datepart calculations, everything looks good.

 

Does anyone know how to solve this?

Thanks!

 

Datediff minutes across different days not calculated correctlyDatediff calculationdefault date format

3 respostas
  1. 29 de dez. de 2022, 17:45

    Example setting:

    Example setting:

0/9000