- Qlikview Tutorial
- QlikView - Home
- QlikView - Overview
- QlikView - Desktop Installation
- QlikView - Architecture
- QlikView - Navigation
- QlikView Data Loading
- QlikView - Excel file
- QlikView - Delimited file
- QlikView - XML file
- QlikView - Web file
- QlikView - Database
- QlikView - Inline Data
- QlikView - Resident Load
- QlikView - Preceding Load
- QlikView - Incremental Load
- QlikView - Data - files(QVD)
- QlikView Report Interface
- QlikView - Sheet and Objects
- QlikView - Scripting
- Qlikview - Functions
- QlikView - IntervalMatch
- QlikView - Aggregate Functions
- QlikView - Match Function
- QlikView - Rank Function
- QlikView - Peek Function
- QlikView - RangeSum Function
- QlikView - Documents
- QlikView - List Box
- QlikView - Multi Box
- QlikView - Text Object
- QlikView - Bar Chart
- QlikView - Pie Chart
- QlikView - Dashboard
- QlikView Data Transformation
- QlikView - Transformation Wizard
- QlikView - Fill Function
- QlikView - Column Manipulation
- QlikView - Rotating Tables
- QlikView Data Model
- QlikView - Dimensions & measures
- QlikView - Star Schema
- QlikView - Synthetic Key
- QlikView - Generating Data
- QlikView Data Analysis
- QlikView - Cross Tables
- QlikView - Straight Tables
- QlikView - Pivot Tables
- QlikView - Set Analysis
- QlikView - Joins
- QlikView - Keeps
- QlikView - Concatenation
- QlikView - Master Calendar
- QlikView - Mapping Tables
- QlikView - Circular Reference
- Qlikview Useful Resources
- Qlikview - Questions/Answers
- Qlikview - Quick Guide
- Qlikview - Useful Resources
- Qlikview - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
QlikView - Joins
Joins in QlikView are used to combine data from two data sets into one. Joins in QlikView mean the same as in joins in SQL. Only the column and row values that match the join conditions are shown in the output. In case you are completely new to joins, you may like to first learn about them here.
Input Data
Let us consider the following two CSV data files, which are used as input for further illustrations.
Product List: ProductID,ProductCategory 1,Outdoor Recreation 2,Clothing 3,Costumes & Accessories 4,Athletics 5,Personal Care 6,Hobbies & Creative Arts ProductSales: ProductID,ProductCategory,SaleAmount 4,Athletics,1212 5,Personal Care,5211 6,Hobbies & Creative Arts,1021 7,Display Board,2177 8,Game,1145 9,soap,1012 10,Beverages & Tobacco,2514
Inner Join
We load the above input data using the script editor, which is invoked by pressing Control+E. Choose the option Table Files and browse for the Input file. Then we edit the commands in the script to create an inner join between the tables.
Inner join fetches only those rows, which are present in both the tables. In this case, the rows available in both Product List and Product Sales table are fetched. We create a Table Box using the menu Layout → New Sheet Objects → Table Box where we choose all the three fields - ProductID, ProductCategory and SaleAmount to be displayed.
Left Join
Left join involves fetching all the rows from the table in the left and the matching rows from the table in the right.
Load Script
Sales: LOAD ProductID, ProductCategory, SaleAmount FROM [C:\Qlikview\data\product_lists.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq); LEFT JOIN(Sales) LOAD ProductID, ProductCategory FROM [C:\Qlikview\data\Productsales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
We create a Table Box using the menu Layout → New Sheet Objects → Table Box, where we choose all the three fields − ProductID, ProductCategory and SaleAmount to be displayed.
Right Join
Right join involves fetching all the rows from the table in the right and the matching rows from the table in the left.
Load Script
Sales: LOAD ProductID, ProductCategory, SaleAmount FROM [C:\Qlikview\data\product_lists.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq); RIGHT JOIN(Sales) LOAD ProductID, ProductCategory FROM [C:\Qlikview\data\Productsales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
We create a Table Box using the menu Layout → New Sheet Objects → Table Box, where we choose all the three fields - ProductID, ProductCategory and SaleAmount to be displayed.
Outer Join
Outer join involves fetching all the rows from the table in the right as well as from the table in the left.
Load Script
Sales: LOAD ProductID, ProductCategory, SaleAmount FROM [C:\Qlikview\data\product_lists.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq); OUTER JOIN(Sales) LOAD ProductID, ProductCategory FROM [C:\Qlikview\data\Productsales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
We create a Table Box using the menu Layout → New Sheet Objects → Table Box where we choose all the three fields - ProductID, ProductCategory and SaleAmount to be displayed.