Display the variance between two variables on multi-line graphs
Best Answer
-
@user08235 Definitely. If you already have them broken out by columns, and your aggregating the other two, then you should be able to create a beast mode that calculates the variance and put it in as another series. So, you'd want to leave the `Sales` and `Budget` columns in the Y-axis and the first series. Make sure they're summed. Then you can create a beast mode that does something like:
SUM(`Sales`) - SUM(`Budget`)
Depending on how you're data is structured, that should do the trick.
Thanks,
Jake
**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
Answers
-
One option might be to use the period over period chart types if you have a date dimension in your dataset. This will give you the variance by default without needing to create a calculated field. Otherwise, you would need to create a new field with the variance calculation you're wanting to display, such as the percent change: (Current Value - Previous Value)/(Previous Value) or (Current / Previous)-1.
At present, there are no default card options for displaying deltas or variances in a data label without creating a calculated field.
1 -
Hey @user08235,
@nicolasfeddern's answer is definitely the easiest. If for some reason that doesn't work for your data, you could also create a DataFlow. Once it's in the card, you can graph your column and break it out by series, but all the values need to be in that column. You can create a DataFlow where you pivot out your series by date period you are measuring (to get your two graphed values on the same row) then add a new column that is the variance between the two new columns you've created. From there, you can append your new column onto the original column and break it out into 3 series: First value, second value, and variance.
Let me know if you'd like more in depth explination.
Thanks,
Jake
**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 -
@Jaketh13 So it actually sounds like I may have my data structured in the way you described (if i'm understanding correctly) because my data is structured by having MONTH as the row, and the 'SALES' and 'BUDGET' values stored in columns (see attachment for visual). In order to create a 'variance' column (variable) and plot all 3 as lines on the same graph (as you suggest), can I do that just using a beastmode calculation that would calculate the:
1. SUM(SALES of X month)
2. SUM(BUDGET of X month)
3. VARIANCE between sum sales and sum budget
*(I don't know what the right formula would be to do that)
Or would I still have to accomplish this using a dataflow?
Let me know if i've completely misunderstood your suggestion, in that case I may need the extra detailed explanation that you offered ? Thanks!
1 -
@user08235 Definitely. If you already have them broken out by columns, and your aggregating the other two, then you should be able to create a beast mode that calculates the variance and put it in as another series. So, you'd want to leave the `Sales` and `Budget` columns in the Y-axis and the first series. Make sure they're summed. Then you can create a beast mode that does something like:
SUM(`Sales`) - SUM(`Budget`)
Depending on how you're data is structured, that should do the trick.
Thanks,
Jake
**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 -
Yes - perfect! I was able to create the variance as it's own field and show all 3 variables in a single graph. Thanks!
1 -
@Jaketh13 One last thing - is it possible to change the style of a line for 1 of the 3 series? For example, make it a dashed line, while the other 2 variables remain sold? This would make it easier for a user to visually see the difference between the 'variance' variable versus the 'sales' and 'budget' variables. Thanks again for your help!
0 -
@user08235, Unfortunately, not yet. The only suggestion I would have is to make it a drastically different color than the other lines using color rules.
That said, it sound like a great idea. For things like this, you can check out our Ideas exchange here https://dojo.domo.com/t5/Ideas-Exchange/idb-p/Ideas. If your idea exists then vote it up, otherwise submit your idea so others can vote it up
Thanks,
Jake
**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
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