- 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 - Circular Reference
Circular Reference occurs when we can traverse from one table to another using two or more different paths. This means you can join Table1 with Table2 directly using a column or you can also first join Table1 with Table3 and then table3 with Table2. This can lead to incorrect result in the output formed by a data model, which loads all these three tables. QlikView prevents the load of such data into its memory once it recognizes a circular reference.
Input Data
Let us consider the following three CSV data files, which are used as input for further illustrations.
SalesCountries: ProductID,ProductCategory,Country,SaleAmount 1,Outdoor Recreation,Italy,4579 2,Clothing,USA,4125 3,Costumes & Accessories,South Korea,6521 4,Athletics,Japan,4125 5,Personal Care,Brazil,5124 6,Arts & Entertainment,China,1245 7,Hardware,South America,456 8,Home & Garden,Peru,241 9,Food,India,1247 10,Home & Garden,Singapore,5462 11,Office Supplies,Hungary,577 ProductCountry: ProductID, Country 3,Brazil 3,China 2,Korea 1,USA 2,Singapore 7,Sri Lanka 1,Italy
Load Script
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.
Data Load
After creating the above script, we load the data to QlikView's memory using the command Control+R. This is when we get the error prompt mentioning the presence of circular loop in the tables getting loaded.
Data Model
To find the exact cause of the above warning we can look at the data model by using the menu command for table viewer - Control+T. The following screen comes up, which clearly shows the circular reference. Here the join between RegionCountry and SalesRegion can be directly achieved using the field Region. It can also be achieved by first going to the table ProductCountry, using the field Country and then mapping ProdcutID with Salesregion.
Resolving Circular Reference
The above circular reference can be resolved by renaming some of the columns in the data sets so that QlikView does not form an association between the tables automatically using the column names. For this, we will rename country column in RegionCountry to SalesCountry. In the data set ProdcuCountry, we rename the Country column to ProductCountry.
Rectified Data Model
The Rectified data model after renaming the column above can be seen using the command Control+T. Now we can see that the relationship between the tables does not form a loop.
Pressing Control+R to reload the data does not give us the warning anymore and we can use this data to create reports.