2024 Week 33 | Sigma: Can you find the safe to eat items?

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

  1. Add the Menu table to Sigma
  2. Extract JSON from Menu Item Health Metrics Obj
    1. Right click on column or click downward facing arrow > Extract Fields
    2. Expand (click right facing arrows) Menu_item_health_metrics until you see the allergy columns
    3. Click on each allergy flag column
    4. Click Confirm
  3. Convert flag columns to True/False
    1. I added a new column for each allergy with ([Column] =”Y”), but there are multiple solutions
  4. Add 3 check box control elements (1 for each allergy)
  5. Calculate if an item is safe to eat
    1. 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)
    2. This if the formula I used where the ones with the underscores are the columns and the ones with dashes are the control element.
      1. ([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)
  6. Create a child table and filter to only safe to eat items and hide unused columns
  7. Create a donut chart with Safe to Eat on the color and Row Count on Value



Scroll to Top