Beast Mode Help: Summary number to show % of transaction type
I have a dataset where there is a column name 'Ship Via Group' that contains three distinct values. One of which, "Counter / WC" I need to show in the summary number for the card - "What percentage of orders are Counter / WC?"
Sample data is attached, note that order number may appear multiple times because orders may have 1 or more items.
Here is the beast mode I tried, but am getting no value returned. I'm a noob... I admit it...
(CASE when `Ship Via Group`='%Counter%' then COUNT(DISTINCT `Order Number`) else 0
END) / COUNT(DISTINCT `Order Number`)
Any help would be greatly appreciated. Thank you in advance!
Best Answer
-
Hi, lets fix your beastmode first to see if that gets you where you want to be. Do this instead: COUNT (DISTINCT CASE WHEN `Ship Via Group` LIKE '%Counter%' THEN `Order Number` ELSE 0 END) / COUNT (DISTINCT `Order NumberDomo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'1
Answers
-
Hi, lets fix your beastmode first to see if that gets you where you want to be. Do this instead: COUNT (DISTINCT CASE WHEN `Ship Via Group` LIKE '%Counter%' THEN `Order Number` ELSE 0 END) / COUNT (DISTINCT `Order NumberDomo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'1 -
I have an issue that I can't seem to remedy... I have a pie chart that is displaying three different order modes.
There are a total of 173 unique order numbers:
- 96 are "Our Truck"
- 58 are "Counter / WC"
- 19 are "UPS / MFT"
I am focused on the "Counter / WC" piece which by dividing the values stated above is 33.5% (58 / 173).
- PIE VALUE is Beast Mode: COUNT(DISTINCT `Order Number`)
- PIE NAME is "Ship Via Group" that contains the text values noted above.
Everything checks out in the pie chart (% and value for each item), all is well.
The Beast Mode for the summary number (which started this discussion) is overstating the count by 1 which causes the summary number and the chart value to not match. The summary number is displaying 34.1% (59 / 173).
Is this a bug? I have looked at my data, and don't see any issues - there are 58 orders.
Is there a way to subtract 1 in the Beast Mode?
0 -
Based on the spreadsheet with the data you attached , Can you check the order number 14178051 , it looks like that one is both Counter / WC and Our Truck.
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
@swagner, I recommend testing a slight change to the beastmode to remove the ELSE 0 statement in the numerator because the COUNT DISTINCT will actually count the 0 as a distinct value and thus inflate your top number by 1.
COUNT (DISTINCT CASE WHEN `Ship Via Group` LIKE '%Counter%' THEN `Order Number` END) / COUNT (DISTINCT `Order Number)
Jacob Folsom
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"2 -
Awesome! This works! ? Thank you!
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