Weird Sorting Issue - Total Sales
Hi, Experts,
I created a domo card in table view for some top-level KPIs. I am running into an issue when I sort by Total Sales (calculated field/beast mode) by ascending you get the column sorted by 0 to the bottom. When you sort by descending it sorts by blanks.
Thoughts or help would be greatly appreciated.
Comments
-
That's functioning as intended. NULLs always appear last. The actual data should appear after the nulls decending. What sort of behavior are you expecting?
If you want to override the sorting behavior you can utilize a separate beast mode to handle the nulls differently and sort based on this new field rather than the actual data field.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@GrantSmith I have never attempted to do that. How would you do that? Can you provide an example how you would do a beast mode for the nulls as you mentioned?
0 -
You can update your calculated field to something like this:
case
when `Total Sales` is null then 0
else `Total Sales`
endIf you can share your `Total Sales` beast mode, I could give you a more concrete example
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
@ST_-Superman-_ has it correct. It's a simple case statement to handle the nulls and replace it with 0.
Depending on your aggregate level you may need to wrap it in a SUM() (or do this on the sorting section of the card building interface)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Here is the code - sorry for the delay.
SUM(CASE
WHEN `rpt_job.authorized` = 1
THEN (`rpt_job.subtotal_sales`) / 100
END)Thanks for your help in advance @ST_-Superman-_
1 -
You should just need a simple tweak to your case statement to include an ELSE clause:
SUM(CASE
WHEN `rpt_job.authorized` = 1
THEN (`rpt_job.subtotal_sales`) / 100
ELSE 0
END)**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@imelendez ... Didn't I harp about null values in our work together? LOL
Domo does not handle nulls well. Get rid of them in your ETL before the card. Beast mode is fine in the interim, but you know I always want it firmly built in ETL if it can be.
DataMaven
Breaking Down Silos - Building Bridges
**Say "Thanks" by clicking a reaction in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as 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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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