Launch, grow, and unlock your career in data

May 19, 2021

#WOW2021 Week 20: Can you compare Same Day to a Selected Date?

No comments

Wow! This workout will really test your knowledge of table calcs. The challenge comes from Lorna; view the requirements here.

The main purpose of this challenge is to get familiar with dates and parameters. Fortunately, every Wednesday I host what we call "Wise Up Wednesday" during lunch for my colleagues at The Information Lab and The Data School. We needed all of our brain power for this one. For us, the toughest part wasn't writing the calculations themselves. Rather, it was the logic required for the calculations.

From Lorna:

What if you want to compare a date you choose to the same DAY. For example, Tuesday 18th May 2021, would compare to Tuesday 19th May 2020 for the previous year, and Tuesday 20th April for the previous month. The reason you would want to do this is to compare the Tuesday to Tuesday.

This is where the logic gets tricky. We approached the solution by taking one version at a time, meaning we started by creating the calcs for the same day last year before we went onto the other two scenarios.

We got the in the end. I'd recommend building everything as a table, then change it into a chart later. It's much easier to follow what you calcs are doing.

Good luck! Here's our solution:

No comments

Post a Comment