2024 Week 34 | Sigma: Can you create a Histogram?

Introduction

Welcome to Week 34!

Creating a histogram in Sigma is easy when you use the built-in Bin functions to divvy up your data. This week we’ll be creating a histogram using a two different Bin functions in Sigma and some controls to make the charts more dynamic!

The formatting styles and colors in this challenge are all up to you. Try to make the report easy to read, with the important data popping!

Have fun!

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

Adding Data


    • Add data table element from TASTY_BYTES_FOOD_TRUCKS schema
      • Sigma Sample Database > Retail > TASTY_BYTES_FOOD_TRUCKS
      • FCT_DAILY_ORDER_PROFIT – has daily order information
    • Creating a Histogram using BinFixed()
      • Create a child element of the table with the following grouping:
        • First grouping level – Order Date
        • Second grouping level – Truck Brand Name
        • Calculations
          • Sum of Gross Profit USD [Total Profit]
        • Summary  – Max of the sum of the Gross Profit USD [Max Profit]
      • Create the following controls on your table:
        • Date range control on the Order Ts column
        • Segmented control with date parts Year, Quarter, Month, Week, Day – use this control to truncate your Order Date in the first grouping level and name the column [Period].
        • Slider control called [# of Bins] with a controlID num-bins
      • Create a calculated column called [Bin Number] using the BinFixed() function, the Total Profit column, the Max Profit summary, and the num-bins control. This will create dynamic bins based on how many bins are selected and the date period selected.
      • Name the table ‘Fixed Bins’
    • Create a child element of the table and name it ‘Fixed Bins Grouped’
      • First Grouping Level – Bin Number
      • Calculations 
        • Min of Total Profit [Min of Range]
        • Max of Total Profit [Max of Range]
        • [Bin Name] (use the concat function and the text() and round() functions to display the bin range as $min of range – $max of range
        • A distinct count of the truck brand names [Total Truck Brands]
    • Create a Bar chart as a child element of the Fixed Bins Grouped table
      • Put the Bin Name in the X axis and the Total Truck Brands in the Y axis
      • Add Data Labels
      • Sort the bins by the Bin Number
      • Name the Chart “Truck brands with [selected period] Profit in Fixed Bin Ranges’ using dynamic text to display the selected period in the title
  • Creating a Histogram using BinRange()
    • Create a new child element of the source table with the following grouping:
      • First grouping level – Truck Brand Name
      • Calculations
        • Sum of Gross Profit USD [Total Profit]
    • Add a target on your existing date range control to include the new table – default to the last 2 years
    • Create a new calculation using the BinRange() function, the Total Profit column, and the following bin cutoff values: 10million, 20million, 30million, 40million, 50million
    • Name the Table Bin Range
    • Create a child element of the table and name it ‘Bin Range Grouped’
      • First Grouping Level – Bin Number
      • Calculations 
        • [Bin Name] – using the switch() function and the [Bin Number] column, manually enter bin ranges for each bin number. ex. bin number 1 – ‘$0 – $10m’ 
        • Distinct count of Truck Brand Names [Total Truck Brands]
      •  Create a Bar chart as a child element of the Fixed Bins Grouped table
        • Put the Bin Name in the X axis and the Total Truck Brands in the Y axis
        • Add Data Labels
        • Sort the bins by the Bin Number
        • Name the Chart ‘Truck Brands with Profit in Named Bin Ranges’
    • Move all the tables to a hidden data tab
    • Move your controls to the top of the page
    • Display both of your histograms side by side
    • Don’t forget to share your solution!

Dataset

Sigma Sample Database > Retail > TASTY_BYTES_FOOD_TRUCKS

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!

Scroll to Top