Replacing IFNull value based on a separate key
Hello and thanks to anyone who responds to this in advance.
I'm relatively new to using DOMO and have been experiencing issues trying to replace null values with the corresponding data. The report that I am using was exported in a weird manner due to how our back end is structured. The primary key (Project ID) exports 2 rows for every value and the column (name) has a null value (every other row). View below for reference.
My goal:
I would ultimately like to have FirstNameLastName + Supplier ID sit on one row per project ID (so replace if null and delete duplicate rows (which I will do through ETL).
Best Answer
-
Hi, @user07596,
Welcome to Domo!
My recommendation is to think of your single dataset as two separate datasets: one, which has the project Name field populated; and the other, which has the supplied ID field populated. In Magic ETL, you can breakt your single dataset into two datasets using a couple of filter tiles:
- Drag an Input tile onto the canvas and configure it by connecting it to your source dataset
- Drag two Filter tiles onto the canvas and connect the Input tile to each one
- Configure the first Filter tile to exclude rows where supplier ID is not null
- The result of this filter will be only the rows that have values in the Name column
- Configure the second Filter tile to exclude rows where name is not null
- The result of this filter will be only the rows that have values in the supplier ID column
- Drag a Join tile onto the canvas and connect both Filter tiles to the Join tile
- Configure the Join tile by selecting the input data sources and by specifying the joining columns as Project ID column. Depending on your data, I would probably suggest using an Inner join.
- You can preview and test your results at this point by clicking the "Preview" button at the top of the canvas.
- You can then check your results coming out of any tile by clicking that tile and then clicking "Preview".
- If you preview the output of the Join tile, you'll see each column is represented twice. That's because it takes all the columns from both of the sources being joined together. You can clean up that output using a "Select Columns" tile.
Hope that points you in the right direction.
-Dan
1
Answers
-
Hi, @user07596,
Welcome to Domo!
My recommendation is to think of your single dataset as two separate datasets: one, which has the project Name field populated; and the other, which has the supplied ID field populated. In Magic ETL, you can breakt your single dataset into two datasets using a couple of filter tiles:
- Drag an Input tile onto the canvas and configure it by connecting it to your source dataset
- Drag two Filter tiles onto the canvas and connect the Input tile to each one
- Configure the first Filter tile to exclude rows where supplier ID is not null
- The result of this filter will be only the rows that have values in the Name column
- Configure the second Filter tile to exclude rows where name is not null
- The result of this filter will be only the rows that have values in the supplier ID column
- Drag a Join tile onto the canvas and connect both Filter tiles to the Join tile
- Configure the Join tile by selecting the input data sources and by specifying the joining columns as Project ID column. Depending on your data, I would probably suggest using an Inner join.
- You can preview and test your results at this point by clicking the "Preview" button at the top of the canvas.
- You can then check your results coming out of any tile by clicking that tile and then clicking "Preview".
- If you preview the output of the Join tile, you'll see each column is represented twice. That's because it takes all the columns from both of the sources being joined together. You can clean up that output using a "Select Columns" tile.
Hope that points you in the right direction.
-Dan
1 -
PS: NullIf/Case/Replace statements won't work in this case. That's because those functions operate on a single row of data. What you're trying to do is collapse data from multiple rows of data. Thus, I believe the Filter/Join method I suggested will be your best bet.
0 -
This was successful. Thank you for your help Dan!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive