Somewhat stupidly I assumed that datediff('day',... would be 0 (or a fraction) if less than 24 hours difference, but it's not because the calculation is based on datepart, so it will always be 1 if the end date is the next day - there could be a 2 minute difference in times (rolling over midnight), but the day difference will still be 1.
datediff('hour',... >24 is what I needed:
Hi Alex,
Thanks for sharing this insight. Yes, Tableau computes DATEDIFF based on the number of boundaries crossed between the two date/time values for the given granularity.
An alternative formula for your example is:
DATEADD('day', 1, [StartDate]) > [End Date]
-Robert
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.