Dynamic colors in bar chart with semi-transactional data
Hello,
I am attempting to create a horizontal bar chart that shows the variance between the sales and sales forecast. A secondary requirement is to be able to filter down by our marketing channels. I have attached the image below of the bar chart I was able to create. The two field used are the Sale Date Time and Sum of Sales Variance. I must be a sum because in the table each row/time combination represents a different marketing channel.
Is it possible to dynamiclly color the bars in the chart green/red for te +/- values? I have seen another post on the community on how to do it but it does not work with hte adding dimension to the data table.
Best Answers
-
Hi @eizquierdo,
I reached out to you over Buzz and was able to solve the issue with you. If you need to do so, please refer to that Buzz conversation for any infomaton regarding this.
Thank you
Maxwell
Dojo User
**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"1 -
Thank you for the help.
Solution:
The solution was to set the card as a stacked bar type. Create two beast mode calcuations, one for the positive values and a second for the negative values.
i.e.
Negative Value = CASE WHEN (SUM(`Sales`) - SUM (`Sales Forecast`)) < 0 THEN SUM(`Sales`) - SUM (`Sales Forecast`) END
Positive Value = CASE WHEN (SUM(`Sales`) - SUM (`Sales Forecast`)) >= 0 THEN SUM(`Sales`) - SUM (`Sales Forecast`) END
The Date\Time field was added as the Y Axis with the Negative Value in the X Axis and the Positive value as the frist Series. Then in the color options you can set your colors for the two series invovled. FYI - The same soluition may be applied to the single bar chart type however you are not able to hide the legend.
1
Answers
-
1
-
Hi @eizquierdo,
I reached out to you over Buzz and was able to solve the issue with you. If you need to do so, please refer to that Buzz conversation for any infomaton regarding this.
Thank you
Maxwell
Dojo User
**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"1 -
Thank you for the help.
Solution:
The solution was to set the card as a stacked bar type. Create two beast mode calcuations, one for the positive values and a second for the negative values.
i.e.
Negative Value = CASE WHEN (SUM(`Sales`) - SUM (`Sales Forecast`)) < 0 THEN SUM(`Sales`) - SUM (`Sales Forecast`) END
Positive Value = CASE WHEN (SUM(`Sales`) - SUM (`Sales Forecast`)) >= 0 THEN SUM(`Sales`) - SUM (`Sales Forecast`) END
The Date\Time field was added as the Y Axis with the Negative Value in the X Axis and the Positive value as the frist Series. Then in the color options you can set your colors for the two series invovled. FYI - The same soluition may be applied to the single bar chart type however you are not able to hide the legend.
1
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