Transforming Date Range to Zero
I have a simple dataset that has activities over time. I like to break that down by week so I can see the week to week workload of the team. For some of the activities being tracked in the data there might not be anything so in my line chart it shows as a blank and the line graph breaks. I've looked at "hide empty values" but that connects one point to the next rather than dropping it back down to zero. Is there a beast mode function I can write that would say for for this week, if null (no values time period) then 0 else count however many there actually were? You can see no activity between week 4 and 6 for the red series. no activity between week 7 and 9 on the green series. etc... how to I drop those to zero?
Answers
-
You'll need to utilize a calendar dimension dataset. Domo has one in the Domo Dimensions connector (calendar.csv). This has all the dates from 2010-2030. I'd recommend filtering the dataset to be before the current date and after or equal to the start date of your data. This will reduce the extra rows which won't be helpful to you. Start with this in your ETL and then LEFT join your data to it. This will cause all of the dates to be populated, however because you're doing a left join the values will be null. You can use a formula tile and then alter your count field with COALESCE:
COALESCE(`Amount`, 0)
This will default the values to 0 to force them to show up on your card.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive