<?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 Link tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368090#M1172961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elaine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;SHead_OrderSource,&lt;/P&gt;&lt;P&gt;Sell-to Customer No_,&lt;/P&gt;&lt;P&gt;PK_SO.No,&lt;/P&gt;&lt;P&gt;SLine_OSQuantity&lt;/P&gt;&lt;P&gt;from Sales.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ItemLEntry:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;PK_LEntry No_&lt;/P&gt;&lt;P&gt;VEntry.Valued Quantity,&lt;/P&gt;&lt;P&gt;VEntry.Document Type,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;from ItemLEntry.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after load SnowFlake....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate(Snowflake)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;%FK_ItemKey,&lt;/P&gt;&lt;P&gt;%FK_Customer&lt;/P&gt;&lt;P&gt;from Sales.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate(Snowflake)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;%FK_ItemKey,&lt;/P&gt;&lt;P&gt;%FK_Customer&lt;/P&gt;&lt;P&gt;from ItemLEntry.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry bad english &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 16:12:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-24T16:12:53Z</dc:date>
    <item>
      <title>Link tables</title>
      <link>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368089#M1172960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I'm new to Qlik but have been developing BI solutions for many years. Could someone please give me some help on link tables. I have attached some notes. all help most appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 15:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368089#M1172960</guid>
      <dc:creator />
      <dc:date>2012-05-24T15:38:55Z</dc:date>
    </item>
    <item>
      <title>Link tables</title>
      <link>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368090#M1172961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elaine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;SHead_OrderSource,&lt;/P&gt;&lt;P&gt;Sell-to Customer No_,&lt;/P&gt;&lt;P&gt;PK_SO.No,&lt;/P&gt;&lt;P&gt;SLine_OSQuantity&lt;/P&gt;&lt;P&gt;from Sales.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ItemLEntry:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;PK_LEntry No_&lt;/P&gt;&lt;P&gt;VEntry.Valued Quantity,&lt;/P&gt;&lt;P&gt;VEntry.Document Type,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;from ItemLEntry.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after load SnowFlake....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate(Snowflake)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;%FK_ItemKey,&lt;/P&gt;&lt;P&gt;%FK_Customer&lt;/P&gt;&lt;P&gt;from Sales.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate(Snowflake)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;"%FK_ItemKey"&amp;amp;"%FK_Customer" as "%FK_ItemKeyCustomer",&lt;/P&gt;&lt;P&gt;%FK_ItemKey,&lt;/P&gt;&lt;P&gt;%FK_Customer&lt;/P&gt;&lt;P&gt;from ItemLEntry.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry bad english &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 16:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368090#M1172961</guid>
      <dc:creator />
      <dc:date>2012-05-24T16:12:53Z</dc:date>
    </item>
    <item>
      <title>Link tables</title>
      <link>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368091#M1172962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A key/link table is frequently required in QlikView to resolve Synthetic Key or Circular Join issues.&amp;nbsp; It can also help to tidy&amp;nbsp; up a schema that has tables all over the place.&amp;nbsp; The goal is to create a star (and sometimes snowflake) schema with dimension tables connected to a central key table.&amp;nbsp; Unlike in classical data warehousing, the central table doesn't often have the measures - they generally stay in the dimension tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 3 rules for creating a key table.&amp;nbsp; The first 2 are very straightforward - the last is where you need to use your skill and judgement to create the right result.&amp;nbsp; So, here are the rules:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; All tables should have a primary key.&amp;nbsp; If a table doesn't have one unique key, derive one using a function like autonumber or autonumberhash256.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Break all the existing joins by renaming foreign keys (e.g. in the Orders table, rename CustomerID to O_CustomerID).&amp;nbsp; For a "pure" star schema, there should be no QlikView Associations remaining and all the tables should be standalone.&amp;nbsp; From a pragmatic point of view, it is fine to leave some hierarchical tables associated (e.g. Product to ProductCategory) to have a more "snowflake" schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Use a mixture of Concatenate and Join to generate the Key table using the Resident data.&amp;nbsp; You will load the previously renamed foreign key with the correct name so that they connect to the right dimension table (e.g. ... O_CustomerID As CustomerID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an example, if I have a simple structure with Customer, Calendar, Order, OrderDetail and Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 - Customer, Product, Calendar (DateKey), and Order already have a primary key.&amp;nbsp; In OrderDetail I will create an ID from OrderID and LineNo (we will do a bit of step 2 while we are at it):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; AutoNumberHash256(OrderID, LineNo) As OrderDetailID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; OrderID as OD_OrderID,&amp;nbsp;&amp;nbsp; // rename order foreign key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ProductID as OD_ProductID, // rename product foreign key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2 - Customer and Product are not an issue because they don't have a foreign key.&amp;nbsp; I already renamed my foreign keys in OrderDetail so I need to attend to Order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; OrderID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID as O_CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DateKey as O_DateKey,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now all my links will be broken.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3 - Now I load my key table.&amp;nbsp; I will begin with data from the Order table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Key:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O_CustomerID As CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O_DateKey as DateKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Resident Order;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Join in the Product and OrderDetail keys from the OrderDetail table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Join (Key) Load&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OD_OrderID As OrderID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OD_ProductID As ProductID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDetailID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Resident OrderDetail;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a key table which will connect all my detail.&amp;nbsp; I can extend this by Joining or Concatenating additional tables.&amp;nbsp; For example, I could concatenate data from Purchases that also has Date and ProductID information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any of the previously renamed foreign keys (e.g. O_CustomerID) can actually be dropped now - their information is encapsulated in the key table so that keeping them is just duplicating data.&amp;nbsp; I might choose to hang onto them for a while, just to test my relations, but best practice will be to remove them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 16:15:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Link-tables/m-p/368091#M1172962</guid>
      <dc:creator />
      <dc:date>2012-05-24T16:15:49Z</dc:date>
    </item>
  </channel>
</rss>

