2024 Week 22 – Top 4 industries + “Other”

Introduction

Hello again, everyone. As data analysts, we are frequently asked to present the “Top N” group members sorted by a metric. In this blog, we’ll try to bring the top 4 accounts industries sorted by count, and group all the following members in a single “Other” bar below the top 4 ones.

Requirements

  • Create a dev org or use an existing org you have access to
  • Connect to the Opportunity, Account objects
  • Join all objects together
  • Include only “Closed Won” opportunities for “Customer” accounts
  • Calculate the total count of opportunities by account industries
  • Sort by count, descending
  • Get the top 4 industries in the first 4 bars, and the remaining industries in a single bar called “Other” below the top 4 bars
  • The groups should not be fixed or hardcoded, they should change dynamically when new data is loaded in the dataset.

The result should be something like this

SAQL

Share

After you finish your workout, share a screenshot of your solutions or interesting insights.

Either on Twitter using the hashtags #WOW2024 and #CRMA and tag @genetis, @LaGMills @msayantani, and @simplysfdc. (Or you can use this handy link to do that)

Or on LinkedIn, tagging Alex Waleczek, Lauren Mills, Sayantani Mitra, Phillip Schrijnemaekers and Johan Yu using the hashtags #WOW2024

Also make sure to fill out the Submission Tracker to track your progress and help us judge the difficulty of our challenges.

Solution

Coming later…
Scroll to Top