March 2019
Beginner
504 pages
11h 17m
English
Often, there will be dimensions or measures you'd like to have in your data, but which are not present in the source. Many times, you will be able to extend your dataset using calculated fields. We already considered an example of creating a field for the full name of the guest where we only had first and last name fields.
Additionally, one thing that might unlock some interesting analysis, is to calculate the length of each rental. We have the start and end dates, but not the length of time between those two dates. Fortunately, this is easy to calculate.
Create a calculated field named Days Rented with the following code:
DATEDIFF('day', [Start Date], [End Date])
Read now
Unlock full access