Create Dataset using Join
- By using this document user will leran to make dataset by using Join.
What is Join?
- A JOIN clause is used to combine rows from two tables, based on a related column between them.
Objectives
- Create Dataset using Joins.
Prerequisites
- For this example we are using Sales.ds, Insurance Claims.ds & Insurance.ds
join Dataset will not be used to Join large Data. It will take more time to execute if we use Join Dataset for large Data.
User can use Pipeline functionality, when they want to join large dataset.
Click here to know more in detail about Pipeline functionality.
Download join.zip file from link given join.zip
- After downloading the zip file, add it into the AIV. To add it into AIV follow this Link
Skill Level Required
- Basic knowledge of Joins & SQL.
To know more about SQL Joins in detail Click here
- There are three types of Joins available:-
I. Inner Join
II. Left Outer Join
III. Right Outer Join
I. Inner Join
Inner Join:- Returns records that have matching values in both tables.
Log in to AIV using your respective credentials.
Go to Hamburger Menu > MasterData > Dataset.
To know more in details about Dataset Section Click here .
User can create dataset using 2 options:-
I. From the Footer Menu
II. From the Context Menu
- Click on Create Dataset option & fill the below details:
- Name: Join Dataset
- Datasource: Join
CLick here to know more about Join Window Terminology.
- Fill the details as shown in the image below:-
- Dataset (at the left side): Insurance Claims.ds
- Dataset Columns: Select all columns available
- Select Join: Inner Join
- Dataset (at the right side): Insurance.ds
- Dataset Columns: Select all columns available
User can select columns as many they want to see in the output.
Click on the key button as shown in the image above.
Select Country From both Dataset Keys.
Click on (+) icon below Key Dataset box.
Select Country||Country from Key Dataset Drop-Down.
Click on Output Columns Tab next to General Tab.
Here user will notice the columns name Insurance Claims:Country & Insurance:Country. Same Country column for Insurance Claims & Insurance dataset.
Click on Preview button.
Click on submit button & your dataset will be created.
II. Left Outer Join
Left Outer Join:- Returns all records from the left table, and the matched records from the right table.
Follow the same steps to 1 to 5 & countiue to follow below steps in order to make dataset with Left Outer Join.
Fill the below details in Create Daataset window:-
- Name: Left Join Dataset
- Datasource: Join
- Fill the below details in Create Dataset window:-
- Dataset (at the left side): Sales.ds
- Dataset Columns: Select country, countrycode, orderDate, productCode, quantityOrdered & priceEach
- Select Join: Left Outer Join
- Dataset (at the right side): Insurance.ds
- Dataset Columns: Select SrNo, Policy_Date, CustomerIDMonth, Year & Country
Click on the key button as shown in the image above.
In order to join 2 dataset we need to select one column from both dataset having matching data.
Select Country From both Dataset Keys.
Click on (+) icon below Key Dataset box.
Select Country||Country from Key Dataset Drop-Down.
Click on Output Columns Tab next to General Tab.
Here user will notice the columns name Sales:Country & Insurance:Country. Same Country column for Sales & Insurance dataset.
Click on Preview button.
Scroll the Vertical & Horizontal bar to see the dataset preview.
Compare Sales:country & Insurance:Country to see the difference in dataset.
This dataset includes the all the data of Sales.ds table & matched data of Insurance.ds table.
Click on submit button & your dataset will be created.
III. Right Outer Join
Right Outer Join:- Returns all records from the right table, and the matched records from the left table.
Follow the same steps to 1 to 5 & countiue to follow below steps in order to make dataset with Right Outer Join.
Fill the below details in Create Dataset window:-
- Name: Right Outer Join
- Datasource: Join
- Fill the below details in Create Dataset window:-
- Dataset (at the left side): Insurance.ds
- Dataset Columns: Select SrNo, Policy_Date, CustomerIDMonth, Year & Country
- Select Join: Right Outer Join
- Dataset (at the right side): Sales.ds
- Dataset Columns: Select country, countrycode, orderDate, productCode, quantityOrdered & priceEach
Click on the key button as shown in the image above.
Select Country From both Dataset Keys.
Click on (+) icon below Key Dataset box.
Select Country||Country from Key Dataset Drop-Down.
Click on Output Columns Tab next to General Tab.
Here user will notice the columns name Insurance:Country & Sales:Country. Same Country column for Insurance & Sales dataset.
Click on Preview button.
Scroll the Vertical & Horizontal bar to see the dataset preview.
This dataset include the all data of Sales.ds table & matched data from the Insurance.ds table.