MIP Logo

Alteryx Challenge 206

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

In this challenge it was required to calculate average hotel stay and count the number of hotel reservation IDs for all hotel reservation that were not cancelled and were at least one day in length.  I decided to do it in 3 steps. First filtering out the non-cancelled reservation and adjusting the data type for date. I first filtered out the data for cancelled reservation status using a filter tool. Then I used a formula to transform the date into appropriate form and then used a datetime parse tp convert it into a date data type.

Figure 1: Filtering Non cancelled reservations

The second step was to calculate the length of stay which had at least 1 day. For this I used a formula tool and used this formula

DateTimeDiff({Arrival date New], [reservation status_date], “days”) Then to filter out data for at least a day length stay I used a filter

Figure 2: Calculating Length of stay

The third and final step was to count the reservation Ids and average hotel stay. For this step I used a summarize tool and grouped by arrival date month, average of length of stay and count distinct of reservation IDs.

Figure 3: Counting Reservation IDs

Share this post