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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 710 Beast Mode
- 50 App Studio
- 39 Variables
- 668 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive