Average for Nested Bar instead of Total, or another option?
Good morning. We'd like to show the average of the two bars in this card, and ideally it would be using a Nested Bar chart but open to other suggestions (currently using a Grouped Bar chart).
CURRENT:
NESTED BAR:
The Value is a beast mode, which takes into consideration the actual sale amount less the valuation, divided by the valuation: (CASE WHEN `Valuation` = 0 THEN 0 ELSE (SUM(`SaleAmount` - `Valuation`)) / SUM(`Valuation`) END)
The Series consists ot the two (2) stores, the bars in the cart would be Store 1 and Store 2.
Any thoughts on how we can achieve this, i.e. an average bar, or line, to show the average of both Valuation to Sale Amount Variances by Store? Thanks
Comments
-
Have you tried utilizing the Line+nested bar chart type?
In this example I've created a simple beast mode for an average of my values for A1, A2, and A3 divided by 3 and plugged that into the Y Axis dimension.
(`A1`+`A2`+`A3`)/3
**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 -
Thanks, @JasonAltenburg, believe that got us in the right direction!
Wat we've done is separate the "stores" out into their own columns (Store 1 & Store 2), and you can see from image 1 that only the row of data that applies to that store appears in the store specific column that was created with a beast mode.
However, we're still not able to properly calculate the individual stores so their bar shows the correct variance seen in image 2 (top portion). The total is correct on the existing card (top) and the new card (bottom), but you'll see the difference in the store variances and the new card (bottom) is incorrect.
Believe it may have something to do with the null values in the newly created columns, and have tried several beast modes to account for them but haven't been able to get it so they reconcile with the individual store variances from the existing card (top).
This beast mode, which separates the stores into new columns, is where we also have to calcualte the correct percentage of 2.95% for each, and this is what we've come up with so far that brings us closest to what we need but still not accurate.
(CASE
WHEN `ParentStore` = 'Store 1' THEN (SUM(IFNULL(`Valuation To Sale Amount Variance`,0)) / COUNT(IFNULL(`Valuation To Sale Amount Variance`,0)))
END)Any additional assistance would be greatly appreciated!
0 -
Any ideas on why we're unable to get the individual stores to reconcile? Is there anything additional that we could provide to help understand the ask better? Thank you in advance for any assistance on this!
0 -
Could you try this as your beastmode?
sum(CASE
WHEN `ParentStore` = 'Store 1' THEN IFNULL(`Valuation To Sale Amount Variance`,0) end)
/
sum(case
when `ParentStore`='Store 1' and ABS(ifnull(`Valuation To Sale Amount Variance`,0))>0 then 1 else 0 end)I'm pretty sure that this expression will count the 0's as a value as well:
COUNT(IFNULL(`Valuation To Sale Amount Variance`,0)))
which is why the average was getting thrown off.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
I did a little bit of testing to confirm my previous post:
I think it really depends on your expected result. I used three different beastmodes to test the outcomes of each.
1. count ifnull
COUNT(IFNULL(`count`,0)))
This was testing the denominator in your original field. This does, indeed, count a value for every row even if there was a null in the dataset.
2. count()
count(`count`)
This will include a count for any row with any value (exlcudes null values)
3. sum()
sum(case when ABS(IFNULL(`count`,0))>0 then 1 else 0 end)
This will tell you the number of rows with a value (excludes 0's and nulls)
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
@ST_-Superman-_would it be ok to DM you, maybe provide some of the raw data we're working with via Excel?
Still unable to get this to work as expected, not sure if it has to do with WHAT we're doing or maybe related to the information provided in this thread not being thorough enough to get the correct feedback on a solution. Thanks!
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