Combining 4 rows into 1 on a dataset
Hello,
We use Google Analytics and I have pulled in data from 4 segments. The data in the table gives 4 rows per day with a column for the segments (there are 4) and another column for my other metric. I would like to combine the segment name and metric data to a column (ie...'segment name' as the column header with the value being the metric...revenue or sessions) for each segment creating one row. Any thoughts?
Thank you
Comments
-
Is anyone able to help out with this request?
0 -
Hi,
You can try this in MySQL Dataflow:
SELECT CASE WHEN `Segment_name` = ' Segment_1' THEN `Value` AS Segment_1,
CASE WHEN `Segment_name` = ' Segment_2' THEN `Value` AS Segment_2,
CASE WHEN `Segment_name` = ' Segment_3' THEN `Value` AS Segment_3,
CASE WHEN `Segment_name` = ' Segment_4' THEN `Value` AS Segment_4
From your_dataset_name
If I correctly understood your question just replace `Segment_name` with the column name that contains the segment name on the original dataset, Value with the column name that contains the segment value on the original dataset, Segment_1, Segment_2,.... with your segment names and your_dataset_name with the name of your original dataset.
Tell me how it goes.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.0 -
Ricardo-Thank you for the reply.
I used the ETL Dataflow function to uncollapse columns and get the new ones all created.
I appreciate your answer and will reference in the future.
Thank you,
Blake0
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