Introduction
Sigma is all about making data manipulations and explorations accessible to everyone! This week’s challenge might sound intimidating, extracting data from JSON, but Sigma makes it a breeze.
Have fun!
-Katrina
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
- Add a data table element from the Tasty Bytes Menu
- Sigma Sample Database > Retail > Tasty Bytes Food Trucks > Menu
- Extract the allergy information from Menu Item Health Metrics
- Create a checkbox control element for each allergy type
- Dairy Free
- Gluten Free
- Nut Free
- Create a pie chart showing the percentage of items that are safe or not safe to eat
- Create a table of the safe to eat items only
Dataset
Sigma Sample Database > Retail > Tasty Bytes Food Trucks > Menu
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
- Add the Menu table to Sigma
- Extract JSON from Menu Item Health Metrics Obj
- Right click on column or click downward facing arrow > Extract Fields
- Expand (click right facing arrows) Menu_item_health_metrics until you see the allergy columns
- Click on each allergy flag column
- Click Confirm
- Convert flag columns to True/False
- I added a new column for each allergy with ([Column] =”Y”), but there are multiple solutions
- Add 3 check box control elements (1 for each allergy)
- Calculate if an item is safe to eat
- This formula looks at if the checkbox is checked, then evaluates if the allergy is safe to eat or if the checkbox is false then the formula returns true (because the user does not care if it is free or not for that allergy)
- This if the formula I used where the ones with the underscores are the columns and the ones with dashes are the control element.
- ([is_dairy_free_flag] = [Is-Dairy-Free] or [Is-Dairy-Free] = False) and ([is_gluten_free_flag] = [Is-Gluten-Free] or [Is-Gluten-Free] = False) and ([is_nut_free_flag] = [Is-Nut-Free] or [Is-Nut-Free] = False)
- Create a child table and filter to only safe to eat items and hide unused columns
- Create a donut chart with Safe to Eat on the color and Row Count on Value