Datediff formula will get you the difference between two dates
Datediff('day',[day of beginning],[day of product order]).
Use this calculated measure on the report to get the exact difference.
Recommend you to go through --->Date Functions - Tableau
DATEDIFF(date_part, date1, date2, [start_of_week])
Returns the difference between
date2expressed in units of
start_of_weekparameter, which you can use to specify which day is to be considered the first day or the week, is optional. Possible values are 'monday', 'tuesday', etc. If it is omitted, the start of week is determined by the data source. See Date Properties for a Data Source.
Supports ISO 8601 dates.
DATEDIFF('week', #2013-09-22#, #2013-09-24#, 'monday')= 1
DATEDIFF('week', #2013-09-22#, #2013-09-24#, 'sunday')= 0
The first expression returns 1 because when
start_of_weekis 'monday', then 22 September (a Sunday) and 24 September (a Tuesday) are in different weeks. The second expression returns 0 because when
start_of_weekis 'sunday' then 22 September (a Sunday) and 24 September (a Tuesday) are in the same week.
Thank you for your answers. I already do know how to check the differences between two dates, but in this case it is a bit more complex, as the Order ID is not the primary data of the workbook. Every line of my workbook has an Unique ID (product level), and one Order ID can have several Unique ID (several products attached).
Would you mind try to do it with the workbook I enclosed ?
Thank you both,
To clarify a little bit, the two dates I want to compare are from the field Date of Product Order (but only when it is 'Food' or 'Extra Demands') and the beginning of the trip.