How can I take multiple columns and create new rows based on the data?
We input some data through a form that is very limited in how it organizes the data. It currently looks similar to this (these are the column headers):
Date / Manager / State / District / Site / Type of Inspection / 1 - Category of Violation / 1 - Violation / 1 - Plan of Correction / 2 - (same 3 column titles) / 3 - (same) / up to 10
I'd like to be able to use the data in a way where the data resembles this...
Date/Manager/State/District/Site/Type of Inspection / 1- Category / 1 Violation / 1 Plan of Correction
Date/Manager/State/District/Site/Type of Inspection / 2- Category / 2 Violation / 2 Plan of Correction
---and so on
The thought being I can then create cards that categorize all category violations in charts with drill paths to the other data (pie chart of categories of violations). I feel like I should be able to use maybe collapse/uncollapse but my efforts have been comical at best.
Any thoughts? Thanks for the help.
Best Answer
-
Hi Jeremy,
Asuming you are doing this in magic ETL this is how you can accomplish this:
- Add a "Select Columns" box from the "Edit Columns" transforms that selects Date/Manager/State/District/Site/Type of Inspection/1 Violation/ 1 Category of Violation/1 Plan of Correction
- Do this for each set of violation data 1...10 - so the only thing that changes for each select statement is the set of 1... 10 number
- Once you have all of the select statements in place pull in an "Append Rows" transform from the "Combine Data" transforms. and append all of the select columns transforms
- Finally push this into an Output data set
This should get you what you are looking for.
Please let me know if you have any questions.
2
Answers
-
Hi Jeremy - I assume you are trying to use Magic ETL to accomplish this task?
Thanks!
1 -
Correct. I'm trying to do it all within there as I am making some other changes as well.
1 -
Hi Jeremy,
Asuming you are doing this in magic ETL this is how you can accomplish this:
- Add a "Select Columns" box from the "Edit Columns" transforms that selects Date/Manager/State/District/Site/Type of Inspection/1 Violation/ 1 Category of Violation/1 Plan of Correction
- Do this for each set of violation data 1...10 - so the only thing that changes for each select statement is the set of 1... 10 number
- Once you have all of the select statements in place pull in an "Append Rows" transform from the "Combine Data" transforms. and append all of the select columns transforms
- Finally push this into an Output data set
This should get you what you are looking for.
Please let me know if you have any questions.
2 -
I should have thought of that. That's perfect. Thanks so much for the help.
1 -
Ok - try my solution below and you should get what you are after. If you need any clarity please let me know.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive