From the course: Tableau: Mastering Calculations
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Calculating simple intervals between two points in time - Tableau Tutorial
From the course: Tableau: Mastering Calculations
Calculating simple intervals between two points in time
We are interested in the distance between two dates. For example, we want to know how long it takes us to dispatch an order after purchase. So let's create a field, processing time in days. We want to calculate the difference between the date of purchase and the date of shipping. Both fields are present in our data source. First, the customer purchases an order, then we ship it to the customer. We could just enter [date of shipping] - [date of purchase]. And this works. The calculation is valid. The problem is, what if only a certain aspect of the interval is relevant to us? Not days, but for example, hours if we have the time information. Or what if we want to know which orders were not shipped until the following month for accounting purposes? Let's take a look at the list of date functions. DATEDIFF sounds like it could be helpful. This function returns the difference between two dates where start date is subtracted from end date. Perfect. Let's use DATEDIFF. We can see that the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
What does row-level mean?28s
-
Cropping and searching strings5m 34s
-
(Locked)
Splitting and replacing strings5m 42s
-
(Locked)
Concatenating strings1m 55s
-
(Locked)
Truncating date fields5m 10s
-
(Locked)
Calculating simple intervals between two points in time3m 7s
-
(Locked)
Calculating complex intervals between two points in time7m 38s
-
(Locked)
Challenge: Combine fields30s
-
(Locked)
Solution: Combine fields1m 26s
-
(Locked)
-
-
-
-
-
-