Joining or Appending Data Help
I have a dataset (dataset 1) with individual rows as a specific job (with an identifier key) with details including year and country of operations. I have created cards to show the total number of jobs per year. I have another dataset (dataset 2) which shows historical revenue by Year and Country but it is not specific to a job (or identifier key). I am wanting to show revenue per year on the same card as the total number of jobs per year, so we can see the trend between the number of jobs and revenue. I've tried to use Magic ETL to "Join" or "Append" data from both datasets but without any good results. I guess the link or common column between the datasets is YEAR but when I merge these columns together the revenue per year is duplicated for everytime that YEAR is mentioned in dataset 1. For example for the whole year of 2009 in the UK, the revenue was $1000, it can't duplicated if there are more jobs in 2009 and in the UK.
Example:
Dataset 1
Job #123 United Kingdom 2009
Job #234 United Kingdom 2009
Job #345 United States 2010
Job #456 United Kingdom 2010
Dataset 2
United States 2009 $1000
United States 2010 $2000
United Kingdom 2009 $1000
United Kingdom 2010 $3000
How can I combine these datasets together to show Number of Jobs per year (bar chart) + Revenue per Year (Line)?
Thank you
Best Answer
-
If you left join the JOBS set with REVENUE set on location and year, you will end up with a column that shows the same revenue for every row in that location and year. You may be able to use this to show what you want if you want to keep the details about each individual job. If you're only looking for the number of jobs per year per location along with the revenue for the year and location, you can aggregate your JOBS set by grouping on location and year and adding a COUNT of the number of rows per group. Then, take the aggregated JOBS set, left join with REVENUE on location and year and you should end up with something like:
LOCATION | YEAR | REVENUE
1
Answers
-
Hi @user000253
I'd recommend using an APPEND tile in an ETL or a DataFusion to UNION your two datasets together. However one caveat to this would be they need to be in the same format / have the same columns
You could process your data to look like the following:
| Job ID | Country | Year | Amount |
| 123 | UK | 2009 | NULL |
| 234 | UK | 2009 | NULL |
| NULL | UK | 2009 | 1000 |
Then in your card you can define two different beast modes:
Job Count:
COUNT(`Job ID`)
Revenue:
SUM(`Amount`)
Then use those two beast modes for your two different values (line and bar)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2 -
Hi @GrantSmith thank you this is very helpful. By process my data do you mean to do this offline as in Excel? Or is there a function in DOMO that I can add columns and make both datasets have the same? As it stands Dataset 1 has 20 columns and dataset 2 only 3 (year, country, amount). Thanks
0 -
If you left join the JOBS set with REVENUE set on location and year, you will end up with a column that shows the same revenue for every row in that location and year. You may be able to use this to show what you want if you want to keep the details about each individual job. If you're only looking for the number of jobs per year per location along with the revenue for the year and location, you can aggregate your JOBS set by grouping on location and year and adding a COUNT of the number of rows per group. Then, take the aggregated JOBS set, left join with REVENUE on location and year and you should end up with something like:
LOCATION | YEAR | REVENUE
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 618 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 741 Beast Mode
- 58 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
- 395 Distribute
- 113 Domo Everywhere
- 276 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