Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Removing Circular Reference

Hi Team,

I have a confusion in resolving Circular Reference from my Application.

I want the most easiest way to resolve it.

I am giving an example of my Table structure:

Table1:                    Table2:                    Table3

Team,                       City                         Country

Country                      Team                         City

How will i remove circular reference from it. Since, All the columns are important in my application I cannot omit it

Regards,

Priyanka

Tags (1)
1 Solution

Accepted Solutions

Re: Removing Circular Reference

Use this code to laod your Employees:

Employees:

LOAD EmployeeID,

     LastName,

     FirstName,

     Title,

     TitleOfCourtesy,

     BirthDate,

     HireDate,

     Address,

     City AS EmployeeCity,

     Region,

     PostalCode,

     Country AS EmployeeCountry,

     HomePhone,

     Extension,

     Photo,

     Notes,

     ReportsTo,

     PhotoPath;

SQL SELECT *

FROM NORTHWND.dbo.Employees;

The reasoning is that it's probably not very useful to look at facts for which both the Employee (Sales Executive) and the Customer live in the same city.

Best,

Peter

19 Replies
Not applicable

Re: Removing Circular Reference

You can rename the Country column in any one of the table.

MVP
MVP

Re: Removing Circular Reference

this can help

Circular References

maxim_senin
Contributor III

Re: Removing Circular Reference

Hi,

Decision on what to do with data depends not only on the data themselves but also on the goals of the application, so first you should understand whether all of the duplicates play the same role or not. E.g. in one app I have two regions - on is plan region and other is fact region of sales.

Say if your Contry fields play the same role it's more then reasonable to put in into one table, as well as other duplicates. Here we come to the idea of link table but again that depends on your requirements.

Best regards,

Maxim

manideep78
Valued Contributor

Re: Removing Circular Reference

Hi Priyanka018

You can rename the any one of the Country Columns or You can go for Loosely coupled tables concept.

Please look for loosely coupled tables concept.

Re: Loosely Couple Table

Circular References

Regards

Manideep

Not applicable

Re: Removing Circular Reference

Hi,

Try using LOSSEN TABLE  tablename for one of the tables.

rgvavihs
Valued Contributor

Re: Removing Circular Reference

Rename Country .

Not applicable

Re: Removing Circular Reference

Hi,

      Reaname the fields i.e using alias

      or use Qualify and Unqulify keyword

Example

Table1:

LOAD * INLINE [

    Team, Country

    A, India

    B, AUS

    C, PAK

]
;





Table2:

LOAD * INLINE [

    Team, City

    A, bangalore

   B, Sydeny

]
;



Table3:

Qualify *;

UNQUALIFY City;

LOAD * INLINE [

    Country, City

    India, banglore

    AUS, Sydeny

]
;
UNQUALIFY;

yadav_anil782
Contributor

Re: Removing Circular Reference

Priyanka  plz go throw this ling for understanding circular loop-

Circular References

MVP
MVP

Re: Removing Circular Reference

There are many ways of resolving the problem, but the real problem is that you need to understand your requirements and your data and decide what you need to do with the 'extra' Country field. Is it:

  • redundant,
  • a different value,
  • one of them can override the other
  • ...

How you handle it is dependent on what it means and what your users will require. You cannot just load and pray.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser