Coalesce for a missing month?
I can't seem to get a magic to work, nor can I seem to get a beast mode to work.
I am sorting data by month. If though, my data does not have data for May (5) then I want there to be a row for May, even if there isn't data.
Somewhat obviously, a case statement wont work because again, when there is no data, then no row.
But, how do I get a row for May? Do I use coalesce?
What if I have no data for May and August?
CASE
WHEN MONTH(AccountingPeriod
) = 1 THEN 1
WHEN MONTH(AccountingPeriod
) = 2 THEN 2
WHEN MONTH(AccountingPeriod
) = 3 THEN 3
WHEN MONTH(AccountingPeriod
) = 4 THEN 4
WHEN MONTH(AccountingPeriod
) = 5 THEN 5
WHEN MONTH(AccountingPeriod
) = 6 THEN 6
WHEN MONTH(AccountingPeriod
) = 7 THEN 7
WHEN MONTH(AccountingPeriod
) = 8 THEN 8
WHEN MONTH(AccountingPeriod
) = 9 THEN 9
WHEN MONTH(AccountingPeriod
) = 10 THEN 10
WHEN MONTH(AccountingPeriod
) = 11 THEN 11
WHEN MONTH(AccountingPeriod
) = 12 THEN 12
else AccountingPeriod
END
Answers
-
@Canio Coalesce is very helpful for null handling, but it cannot add new rows to your data. Some chart types (like bar charts) have an option to fill in missing dates if a date field is used in the X axis. Otherwise, you will need to create a separate period mapping dataset to join or append in a dataflow and add the missing rows.
0 -
@MichelleH ,
That's what I thought. Outer joins in Magic don't work, so I was hoping I could use a beast mode. Thank you0 -
If you want to append row you wouldn't do a JOIN but use the APPEND tile instead, just make sure you format your data to include any datapoints you want and any possible combinations by which your users might need to be able to filter on, otherwise, as soon as a filter gets applied to the dataset, your FILLED rows will just banish.
0 -
@MichelleH I was able to get what I needed. It just took a little work.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive