<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: What is Circular reference? How to avoid them? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605659#M1098802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When designing a datamodel in Qlikview, circular reference is quite a common thing.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;There are several solutions to prevent such loops like the concatenate function or link table. Although the best solution to fix circular reference depends on the situation, I personally prefer the link table most of the times. When you have two fact tables for example, which shares more then one dimension, it means there is circular reference.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture11.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture1" class="wp-image-918 size-medium aligncenter jiveImage" height="239" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture11-300x239.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture1" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;To prevent this situation we could use the concatenate function to create one major facttable. You could consider this solution when both tables have many similarities. When using the concatenate function, always dwell on the fact that, if the measure fields in both facttables are the same, calculations will cover all records of the table. Of course there is the possibility to create a field and specify the facttype so you can select ‘Fact1’ or ‘Fact2’ and use set analysis in your expressions but I think it’s clear that this isn’t an easy solution when the records always need to be separated in all expressions.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;Example 1: Concatenate two fact tables.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;//**************************************************************************&lt;BR /&gt;// FACT TABLE&lt;BR /&gt;//**************************************************************************&lt;BR /&gt;FACT:&lt;BR /&gt;load&lt;BR /&gt;‘Fact1’&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Facttype&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_FACT1_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure&lt;BR /&gt;From……&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;CONCATENATE&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;load&lt;BR /&gt;‘Fact2’&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Facttype&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_FACT2_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure&lt;BR /&gt;From……&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;What about concatenate if the fields in the facttables are quite different? Rationally this does not seem to be a good idea is it? Let’s demonstrate this with an example of two different processes.&amp;nbsp; The facts are:&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;- The purchase of products&lt;BR /&gt;- The selling of products&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When loading the original datamodel, Qlikview has to create a synthetic key because the dimensions date and product are shared. Although the synthetic key in this situation works fine, it’s better to prevent this.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture3.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture3" class="size-medium aligncenter jiveImage wp-image-935" height="162" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture3-300x162.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture3" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When we concatenate the purchase and selling table, the synthetic key is gone and the problem is solved. Allthough naturally this just doesn’t feel like the ‘right’ way, there is no difference for the end user because the interface of Qlikview works on attribute level. For Qlikview, this is best practice and a good way of solving circular reference. Keep in mind that, for solutions with many tables, the overall picture for the developer is getting less clear. In that case it’s better (in my opinion) to use link tables.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture4.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture4" class="size-medium aligncenter wp-image-936 jiveImage" height="236" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture4-300x236.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture4" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;STRONG&gt;The use of Link Tables&lt;/STRONG&gt;&lt;BR /&gt;With the use of link tables, it’s possible to keep the facttables separated from each other. The advantage of this solution is that there is no need for set analysis when doing calculations for fact 1 or fact 2 when they share the same measure. Another reason for choosing this method is to keep the datamodel a logical one.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture2.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture2" class="size-medium wp-image-913 aligncenter jiveImage" height="265" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture2-300x265.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture2" width="300" /&gt;&lt;/A&gt;The link table contains the key fields of the facts and dimensions. It is likely that the two fact tables don’t have the same keyfields. We can use both unique key fields and give them the same fieldname in the linktable to create a unique id for each record. Because Qlikview loaded all necessary keys in the facttables, we can simply use a resident load. Below shows an example of a linktable. As you can see, I use %% to indicate it’s a key for the dimension and % for the fact.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;//**************************************************************************&lt;BR /&gt;// LINK TABLE&lt;BR /&gt;//**************************************************************************&lt;BR /&gt;LNK_TABLE:&lt;BR /&gt;load distinct&lt;BR /&gt;%KEY_FACT1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_LNK_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM1_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM2_ID&lt;BR /&gt;RESIDENT Fct1;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;CONCATENATE&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;load distinct&lt;BR /&gt;%KEY_FACT2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_LNK_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM2_ID&lt;BR /&gt;RESIDENT Fct2;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;STRONG&gt;Automated Link script&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;In the &lt;A href="http://community.qlik.com/media/p/76744.aspx" style="color: #333333;"&gt;share Qlikviews section&lt;/A&gt; of the QlikCommunity you can find a script from Lars Christensen that automatically creates a linktable and removes synthetic keys from “any” combination of tables. Using this code in our example brings the following model:&lt;BR /&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture5.JPG" style="color: #555555;"&gt;&lt;IMG alt="picture5" class="size-medium aligncenter jiveImage wp-image-937" height="140" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture5-300x140.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture5" width="300" /&gt;&lt;/A&gt;&lt;BR /&gt;Bear in mind, use carefully, and don’t trust it is working 100% until you have verified your data -&amp;nbsp; this is experimental code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2014 05:32:56 GMT</pubDate>
    <dc:creator>sujeetsingh</dc:creator>
    <dc:date>2014-05-07T05:32:56Z</dc:date>
    <item>
      <title>What is Circular reference? How to avoid them?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605657#M1098800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif';"&gt;. &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif';"&gt;What is Circular reference? How to avoid them?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 05:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605657#M1098800</guid>
      <dc:creator />
      <dc:date>2014-05-07T05:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: What is Circular reference? How to avoid them?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605658#M1098801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what you need&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/45424"&gt;How circular reference can be avoided?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 05:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605658#M1098801</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-05-07T05:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: What is Circular reference? How to avoid them?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605659#M1098802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When designing a datamodel in Qlikview, circular reference is quite a common thing.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;There are several solutions to prevent such loops like the concatenate function or link table. Although the best solution to fix circular reference depends on the situation, I personally prefer the link table most of the times. When you have two fact tables for example, which shares more then one dimension, it means there is circular reference.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture11.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture1" class="wp-image-918 size-medium aligncenter jiveImage" height="239" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture11-300x239.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture1" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;To prevent this situation we could use the concatenate function to create one major facttable. You could consider this solution when both tables have many similarities. When using the concatenate function, always dwell on the fact that, if the measure fields in both facttables are the same, calculations will cover all records of the table. Of course there is the possibility to create a field and specify the facttype so you can select ‘Fact1’ or ‘Fact2’ and use set analysis in your expressions but I think it’s clear that this isn’t an easy solution when the records always need to be separated in all expressions.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;Example 1: Concatenate two fact tables.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;//**************************************************************************&lt;BR /&gt;// FACT TABLE&lt;BR /&gt;//**************************************************************************&lt;BR /&gt;FACT:&lt;BR /&gt;load&lt;BR /&gt;‘Fact1’&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Facttype&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_FACT1_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure&lt;BR /&gt;From……&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;CONCATENATE&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;load&lt;BR /&gt;‘Fact2’&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Facttype&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_FACT2_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure&lt;BR /&gt;From……&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;What about concatenate if the fields in the facttables are quite different? Rationally this does not seem to be a good idea is it? Let’s demonstrate this with an example of two different processes.&amp;nbsp; The facts are:&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;- The purchase of products&lt;BR /&gt;- The selling of products&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When loading the original datamodel, Qlikview has to create a synthetic key because the dimensions date and product are shared. Although the synthetic key in this situation works fine, it’s better to prevent this.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture3.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture3" class="size-medium aligncenter jiveImage wp-image-935" height="162" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture3-300x162.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture3" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;When we concatenate the purchase and selling table, the synthetic key is gone and the problem is solved. Allthough naturally this just doesn’t feel like the ‘right’ way, there is no difference for the end user because the interface of Qlikview works on attribute level. For Qlikview, this is best practice and a good way of solving circular reference. Keep in mind that, for solutions with many tables, the overall picture for the developer is getting less clear. In that case it’s better (in my opinion) to use link tables.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture4.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture4" class="size-medium aligncenter wp-image-936 jiveImage" height="236" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture4-300x236.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture4" width="300" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;STRONG&gt;The use of Link Tables&lt;/STRONG&gt;&lt;BR /&gt;With the use of link tables, it’s possible to keep the facttables separated from each other. The advantage of this solution is that there is no need for set analysis when doing calculations for fact 1 or fact 2 when they share the same measure. Another reason for choosing this method is to keep the datamodel a logical one.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture2.JPG" style="color: #333333;"&gt;&lt;IMG alt="picture2" class="size-medium wp-image-913 aligncenter jiveImage" height="265" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture2-300x265.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture2" width="300" /&gt;&lt;/A&gt;The link table contains the key fields of the facts and dimensions. It is likely that the two fact tables don’t have the same keyfields. We can use both unique key fields and give them the same fieldname in the linktable to create a unique id for each record. Because Qlikview loaded all necessary keys in the facttables, we can simply use a resident load. Below shows an example of a linktable. As you can see, I use %% to indicate it’s a key for the dimension and % for the fact.&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;//**************************************************************************&lt;BR /&gt;// LINK TABLE&lt;BR /&gt;//**************************************************************************&lt;BR /&gt;LNK_TABLE:&lt;BR /&gt;load distinct&lt;BR /&gt;%KEY_FACT1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_LNK_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM1_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM2_ID&lt;BR /&gt;RESIDENT Fct1;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;CONCATENATE&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;load distinct&lt;BR /&gt;%KEY_FACT2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %KEY_LNK_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM1_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM_ID&lt;BR /&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; %KEY_DIM2_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS %%KEY_DIM2_ID&lt;BR /&gt;RESIDENT Fct2;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;&lt;STRONG&gt;Automated Link script&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: 18px; color: #555555; font-family: 'Century Gothic', 'Avant Garde', Arial, Helvetica, sans-serif; font-size: 14px;"&gt;In the &lt;A href="http://community.qlik.com/media/p/76744.aspx" style="color: #333333;"&gt;share Qlikviews section&lt;/A&gt; of the QlikCommunity you can find a script from Lars Christensen that automatically creates a linktable and removes synthetic keys from “any” combination of tables. Using this code in our example brings the following model:&lt;BR /&gt;&lt;A href="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture5.JPG" style="color: #555555;"&gt;&lt;IMG alt="picture5" class="size-medium aligncenter jiveImage wp-image-937" height="140" src="http://www.quickqlearqool.nl/wp-content/uploads/2009/10/picture5-300x140.jpg" style="border: none; margin-left: auto; margin-right: auto; margin-bottom: 10px;" title="picture5" width="300" /&gt;&lt;/A&gt;&lt;BR /&gt;Bear in mind, use carefully, and don’t trust it is working 100% until you have verified your data -&amp;nbsp; this is experimental code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 05:32:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605659#M1098802</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-05-07T05:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: What is Circular reference? How to avoid them?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605660#M1098803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi please go through this link below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/06/25/circular-references" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/06/25/circular-references"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/06/25/circular-references&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 05:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605660#M1098803</guid>
      <dc:creator />
      <dc:date>2014-05-07T05:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: What is Circular reference? How to avoid them?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605661#M1098804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thankyou sujeeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 14:26:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-Circular-reference-How-to-avoid-them/m-p/605661#M1098804</guid>
      <dc:creator />
      <dc:date>2014-05-07T14:26:50Z</dc:date>
    </item>
  </channel>
</rss>

