Introduction
Welcome to Week Forty-Four! This week, I wanted to have a little fun because not only is Thursday Halloween, but it’s also my birthday. As someone who loves data and shares her birthday with a holiday, I am interested to see just how common holiday birthdays are.
In this challenge, you will use a couple of datasets that I have curated for you from Kaggle. Due to the availability of free datasets, we’re looking at US birthdays from 1969-1988 and 2023 US holidays. Using those datasets, you will create a small dashboard that lets you practice some concepts you’ve recently learned through my challenges, as well as craft a custom function to bin birthdays.
Good Luck and Happy Halloween!
-Ashley
Need access to Sigma?
Note: You will only have view access to WOW Workbooks, Folders, and Workspaces, not edit access. Please create your WOW Workbooks under “My Documents.” We suggest creating a folder to organize all your workbooks.
Requirements
- On a hidden Data Tab:
- First, we want to create a table with our filter values:
- Add the US Holidays 2023 dataset:
- Workspaces / Workout Wednesday / 2024 / 2024W44 – Holiday Birthdays / US Holidays 2023
- This table contains all holidays from our main dataset, and allows fanning when a single day contains multiple holidays.
- Create a new page control with the [Name] column as its value source.
- This control should target the US Holidays data table.
- Allow multiple selection
- Do not show the null option
- Do not show the histogram
- Sort the suggestions alphabetically
- Name this control Holiday
- Create a second page control, using the [Type] column as its value source.
- This control should target the US Holidays data table.
- Allow multiple selection
- Do not show the null option
- Name this control Holiday Type
- Add the US Holidays 2023 dataset:
- Next, we want to bring our main dataset into the workbook. All visualization elements will be built as children of this table.
- Add the Birthdays by State & Year dataset in another table:
- Workspaces / Workout Wednesday / 2024 / 2024W44 – Holiday Birthdays / Birthdays by State & Year
- Note all of the metrics available
- Now we want to add two columns that will return a Boolean based on the page controls we have created. You will create one that checks the Holiday control and another that checks the Holiday Type control. Each function used should:
- Check if the control has value. If it does not, the column should always return [Is Holiday], for both the Holiday and Type versions of this column.
- Check the intersection of the control’s array and the table’s array (either [Holiday Array] or [Type Array]). If that intersection has value, then the column should return True. Otherwise, it should always return False.
- Unlike previous challenges, we do not want to filter this data source table by either of these columns. We do want to create one more Boolean column, called [Is Filtered Holiday or Type?], that compares both of these new columns. This column will be used downstream as a Color and as part of a custom calculation to compare selected holiday births to all other births.
- Note: Technically, the previous 2 columns could be combined with this one, but it is easier on future you to break this more complex logic into 3 columns.
- Because the Holiday filter’s suggestions are a finer granularity than the Type, first check if the Holiday control has value.
- If so, return the [In Holiday Filter?] column you created above.
- If not, check if the Type control has value. If so, return [In Type Filter?] column you created above.
- If neither of those criteria are met, return the dataset’s [Is Holiday] column.
- Add another calculated column to return the [Filtered Holiday Births]. The logic for this column should return the births column if [Is Filtered Holiday or Type?] is True. If it is False, this column should be null.
- Finally, add a calculated column that groups the Year column into it’s respective [Decade] (i.e. 1960’s, 1970’s, 1980’s).
- Note: There are multiple ways to do this
- Add the Birthdays by State & Year dataset in another table:
- First, we want to create a table with our filter values:
- On a visible page:
- Create a horizontal bar graph:
- X-Axis: Holiday(s)
- Y-Axis: Total Births on Holiday Metric
- Filter to show only the Top 10 where [Is Filtered Holiday or Type] = True
- Formatting:
- Title: Top Holiday Birthdays
- Y-Axis label size: 10
- Add Data Labels in Middle
- Create a Donut Chart
- Color: [Is Filtered Holiday or Type?]
- Value: Total Births Metric
- Donut Hole Value: A new calculated column called [Holiday Birth Rate] that divides the sum of [Filtered Holiday Births] by the Total Births metric. This should be formatted as a percentage.
- Formatting:
- Title: Total Births vs Holiday Births
- Bonus: Instead of “Holiday Births”, add a dynamic title that returns the Holiday or Type control selected value (i.e. Total Births vs Halloween Births)
- Legend: Show with Header
- Give the Header a short, user-friendly name
- Title: Total Births vs Holiday Births
- Create a line graph:
- X-Axis: [Month Name] sorted in chronological order
- Y-Axis: Create the same [Holiday Birth Rate] used in the Donut
- Trellis Column: [Decade]
- Formatting:
- Hide the Trellis Column Title
- Add a Reference Line showing the Average Holiday Birth Rate
- Show label text and value
- Show a smooth line
- Color each Decade’s line its own color
- Create a horizontal bar graph:
- Finishing Touches
- Give the Page a Descriptive Title
- Arrange your elements into a cohesive dashboard. Don’t forget to move the controls to the visible page!
- Be sure that the colors make cohesive sense. For example: The True values in the donut denote Holiday Birthdays. Does that color match the bar graph displaying Holiday Birthdays?
Dataset
Workspaces / Workout Wednesday / 2024 / 2024W40 – Can you avoid the food?
Share
After you finish your workout, share on LinkedIn, Sigma’s Community page, (or Twitter) using the hashtags #WOW2024 and #SigmaComputing, and tag Ashley Bennett, Eric Heidbreder, Katrina Menne, and Michal Shaffer!
Create an interactive, sharable version of your solution here.
Also, make sure to fill out the Submission Tracker so that we can count you as a participant this week to track our participation throughout the year.
Solution
Coming soon….