Beast Mode to compare Values in 1 Column against 2 time periods
I have access to a dataset at my organization that pulls in competitor data.
The question I want to answer with my card is:
- Who is/are the new competitor(s) that showed up last week (fully completed week) compared to competitors from last 12 weeks (exluding the prior completed week)
I have built out a dash that starts at a high level (period over period line bar chart) that shows # of competitors by week and the WoW variance on the secondary axis. I also have some aggregate level competitor metric charts built out too.
What I want to do next is go a little bit deeper and build out a table that will show who are the NEW competitors last week
These are the primary columns in my dataset that I will be using (bolded would be what I will use for the pivot table - the metrics were for the charts I made):
- Column A is Date (by Day)
- Column B is Competitor
- Column C is Metric 1
- Column D is Metric 2
Conceptually, I want to build this out via a pivot table
- "Column B aka Competitors" Will be a row
- The "Values" Column is where I would like to build out a Beast Mode. I've been trying to build a beast mode that will:
- Look at Last Week's Competitors compared to all competitors from the previous 12 weeks (excluding last week).
- If last week's competitor is NEW then mark it with a 1 and if they are not new, mark it with a 0
- add a filter to only show values with "1" since the pivot table can't return "strings".
It would probably look better if I could bucket new competitors as "NEW" and existing as "Existing" but I couldn't get my pivot to return those values when I did a rudimentary beast mode attempt.
The finished table will only list the competitors who are new/have a "1" flag. for the value, I'm fine with it just saying 1.
I have been tinkering with my beast mode for the better part of the work day without avail so here I am . I think I am bungling these "nested" case statements quite badly...
CASE WHEN WEEK(`Date`) = WEEK(CURRENT_DATE()) - 1 then `Competitor` <> 'Competitor' WHEN WEEK(`Date`) > WEEK(CURRENT_DATE()) - 14 and WEEK(CURRENT_DATE()) < WEEK(CURRENT_DATE()) - 1 THEN '1' ELSE '0' END
I'm just trying to make it look at competitors from last week compared to last "14" weeks since I won't be counting the previous week...
- All Categories
- 1.1K Product Ideas
- 1.1K Ideas Exchange
- 1.2K Connect
- 966 Connectors
- 254 Workbench
- Cloud Amplifier
- 1 Federated
- 2.4K Transform
- 75 SQL DataFlows
- 499 Datasets
- 1.8K Magic ETL
- 2.7K Visualize
- 2.2K Charting
- 360 Beast Mode
- 19 Variables
- 168 Cards, Dashboards, Stories
- 481 Automate
- 101 Apps
- 376 APIs & Domo Developer
- 6 Workflows
- 22 Predict
- 6 Jupyter Workspaces
- 16 R & Python Tiles
- 316 Distribute
- 64 Domo Everywhere
- 252 Scheduled Reports
- 59 Manage
- 59 Governance & Security
- 1 Product Release Questions
- 5K Community Forums
- 37 Getting Started
- 23 Community Member Introductions
- 63 Community Announcements
- 4.8K Archive