Creating stacked bar chart from columns in data set
I would like to create a stacked bar chart that shows one stacked bar each for several columns in my data set, but not all of them. The number of different values contained within the columns would be the stacks. For example, say I have the attached dataset, then I want to make a chart similar to the one depicted in the other attached file.
Best Answers
-
Ok so if you've got the dataset described and you're wanting to show 3 different column names along the X axis, then you'll need to modify your original dataset so that all 3 column names can be found within a single column of data.
Using a SQL transform you could do something like this:
SELECT `col 1` AS 'Value', 'col 1' AS 'column_name'
FROM dataset
UNION ALL
SELECT `col 2` AS 'Value', 'col 2' AS 'column_name'
FROM dataset
UNION ALL
SELECT `col 3` AS 'Value', 'col 3' AS 'column_name'
FROM datasetThis would result in a Value column and a column_name column. With this new dataset, use column_name as your X axis. A COUNT of Value as your Y Axis and the Value column as-is for your Series.
I believe that should get you what you need.
Let me know if you have any questions,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
Go to the Datacenter and on the top white strip, look for the Magic Transform section. Click on the SQL icon and select either MySQL or Redshift(i dont' think it matters). From the next page, click on the select the Input Dataset drop down and select the dataset you have created. Then click on Add Output dataset and write you're SQL in there. Don't forget to click on Additional Options and select when you want the dataflow to run.
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
Answers
-
Ok so if you've got the dataset described and you're wanting to show 3 different column names along the X axis, then you'll need to modify your original dataset so that all 3 column names can be found within a single column of data.
Using a SQL transform you could do something like this:
SELECT `col 1` AS 'Value', 'col 1' AS 'column_name'
FROM dataset
UNION ALL
SELECT `col 2` AS 'Value', 'col 2' AS 'column_name'
FROM dataset
UNION ALL
SELECT `col 3` AS 'Value', 'col 3' AS 'column_name'
FROM datasetThis would result in a Value column and a column_name column. With this new dataset, use column_name as your X axis. A COUNT of Value as your Y Axis and the Value column as-is for your Series.
I believe that should get you what you need.
Let me know if you have any questions,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
Thanks for replying ValiantSpur.
This is very intuitive and makes sense to me. The only thing I'm unsure about is how to use this transform in Domo. Do I input it into beastmode or where do I code this in the interface?
Cheers,
user03896
0 -
Go to the Datacenter and on the top white strip, look for the Magic Transform section. Click on the SQL icon and select either MySQL or Redshift(i dont' think it matters). From the next page, click on the select the Input Dataset drop down and select the dataset you have created. Then click on Add Output dataset and write you're SQL in there. Don't forget to click on Additional Options and select when you want the dataflow to run.
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 -
Thank you Godzilla! The transform worked.
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