2023: Week 16 - Solution
Solution by Tom Prowse and you can download the workflow here.
Following from looking at Easter Sunday dates last week, we are now going to look why there is so much variation with Easter dates and how the moon reflects this.
Step 1 - Tidy Full Moon Input
First, we want to input the Full_Moon table and rename the fields:
- Day = Full Moon Day
- Date = Full Moon Date (make sure this is a Date field type)
We can then clean the Time field to match the requirements. First we want to remove all the Numbers and Letters from the field so we are left with only the symbols that represent the different types of moons.
Then we want to replace the symbols with the corresponding type of moon as given in the requirements. As a result we should now have the 4 different types of moons in our table:
Step 2 - Include Easter Sunday
We can now include the dates for Easter Sunday by joining the Easters table using an inner join where Full Moon Date <= Easter Sunday:
Now we have both tables together we can calculate the Days between the full moon and Easter:
Days Between
DATEDIFF('day',[Full Moon Date],[Easter Sunday])
Then we can calculate the closest (minimum) days for each Easter Sunday by using a Fixed LOD calculation:
Then we can filter where [Days Between Full Moon & Easter Sunday]=[Days between] and this will get us a row for each Easter Sunday and the closest Full Moon Date for each.
As Easter only occurs once a year, we can convert the both of the dates to a Year