3 Replies Latest reply on May 4, 2015 7:45 AM by Tom W

# Global Date

So this might be a very basic question, but i cannot seem to derive a solution.

I need to report average lead times between milestones, or tasks. So I have about 50 different tasks and the calculations are simply

Calculation1 = DATEDIFF('day',[task2], [task1]) = x days

Calculation2 = DATEDIFF('day',[task3], [task2]) = x days

Calculation3 = DATEDIFF('day',[task4], [task3]) = x days

.

.

.

CalculationX = DATEDIFF('day',[taskX], [taskX-1) = x days

The issue is that i need to allow the user to filter ALL tasks by a particular date range. i.e. he wants to see the average number of days in march, or january.

I don't have a "global date" field that i can use as a filter. So everytime i drag for instance task2 to the filter shelf, it only applies the filter to the Calculation2 and 3 fields, when i might have many other Calculations on my view.

Does anyone know how i could solve this problem or have any suggestions on how to better handle this?

Thanks

• ###### 1. Re: Global Date

Please upload a Tableau Packaged Workbook with sample data

• ###### 2. Re: Global Date

Hi Tom W,

Please find the workbook attached.

• ###### 3. Re: Global Date

Give this a shot; Create two parameters, one for a start date and one for an end date. Then show these in the sheet so the user can specify a date range i.e. 1/1/2015 > 3/31/2015.

Create a calculated field called 'includedata' as follows:

if ([Milestone1] >= [pStartDate] and [Milestone1] <= [pEndDate])

or ([Milestone2] >= [pStartDate] and [Milestone2] <= [pEndDate])

or ([Milestone3] >= [pStartDate] and [Milestone3] <= [pEndDate])

or ([Milestone4] >= [pStartDate] and [Milestone4] <= [pEndDate])

then 'yes'

else 'no'

end

Drag the calculated field onto the filters shelf and select yes.