Shredding date data to extract Calendar information
In this recipe, you'll learn how the different functions that are available in Snowflake can help us extract parts of data, such as the day, day of the week, week of the year, name of the day, and important days in business reporting cycles, such as the last day of the month or the first day of the month. These capabilities are essential in data warehousing as most of the data uses time and date as dimensions. Along the way, this recipe shall introduce some pitfalls related to the start of the week configuration in Snowflake. You'll learn how to develop a utility calendar table with different columns related to the date.
Getting ready
Note that this recipe's steps can be run either in the Snowflake WebUI or the SnowSQL command-line client.
How to do it…
As part of this recipe, we shall start with a simple date generator. The generator function will be used to generate calendar dates for the calendar...