<?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 Script - Synthetic Key in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525423#M196385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to remove Synthetic Key enclosed file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Aug 2013 14:10:24 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2013-08-23T14:10:24Z</dc:date>
    <item>
      <title>Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525423#M196385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to remove Synthetic Key enclosed file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525423#M196385</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2013-08-23T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525424#M196386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rename %PG as SomeOtherName in Inventory and SalesData table.&lt;/P&gt;&lt;P&gt;One More field as %PG in SalesData, for mapping purpose between SalesData and Purchase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, your SalesData looks like&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;%PG as PG,&lt;/P&gt;&lt;P&gt;%PG,&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;From SalesData;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inventory:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;%PG as PG,&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;From Inventory;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:16:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525424#M196386</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-08-23T14:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525425#M196387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;In Inventory and Sales Data %PG and %PrimeSupplierID are creating a Synthetic key.&lt;/P&gt;&lt;P&gt;%PG is coming from PRODUCTGROUP table and I need %PG in both above table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525425#M196387</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2013-08-23T14:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525426#M196388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assumend Inventory has the master data.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventory:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [%PG]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[%PrimeSupplierID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[%PG] &amp;amp; [%PrimeSupplierID] AS [%PG_PrimeSupplierID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[ECP Value]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,.......&lt;/P&gt;&lt;P&gt;FROM Source;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SalesData:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [%PG] &amp;amp; [%PrimeSupplierID] AS [%PG_PrimeSupplierID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[Sales Value]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[Cost Value]&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;FROM Source;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will form joins between two tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:41:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525426#M196388</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2013-08-23T14:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525427#M196389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;All three tables enclosed.... only necessary dimensions are shown....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Inventory:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD [Prime Supplier] as %PrimeSupplierID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Part Number], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Left([Part Number],3) as %PG,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOTAL as InventoryTotalValue, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SumOfQuantity as InventoryTotalQty&lt;/P&gt;&lt;P&gt;FROM .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesData:&lt;/P&gt;&lt;P&gt;LOAD P_group2 as %PG, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PSupp as %PrimeSupplierID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Net Sales] as [Sales Value], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cost as [Cost Value], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qty as [Qty Sold], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month as SalesMonth&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FROM .....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PRODUCTGROUP:&lt;/P&gt;&lt;P&gt;LOAD PC as %PG, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PCNAME as PGName,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FROM .........&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 15:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525427#M196389</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2013-08-23T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Synthetic Key</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525428#M196390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a classic example of the typical Data Modelling challenge.You have 2 facts (Sales and Inventory) that share more than one common key. There are 3 approaches to this situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do nothing and leave the Synthetic key (this "solution" was suggested by John Witherspoon, and a representative from QlikTech confirmed that this type of a synthetic key will work just fine. Many QlikView practitioners (myself included) prefer not to leave synthetic keys, for better scalability and for the sake of "clean programming".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create a Link Table - identify your common keys, and create a single key, built as a concatenation of the individual keys. Your Facts will be linked by the combo key, and your common keys will only be stored in the Link Table. You can probably find more information about Link Tables if you search this forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Create a single Concatenated Fact. Concatenate both of your Fact tables into a single fact. All the common keys will get combined into a single field, and other fields will be added accordingly. This is the most scalable and the best performing model, however you lose the direct association between the two facts - in other words, it will be less trivial to show Sales Data for a Part Number associated with certain Inventory Balance, or to show Inventory of all the Items sold to a specific Customer (if that's needed). For those requirements, you need to create additional associations, but that's definitely too much to explain in a single forum message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qlikfix.com/"&gt;Barry Hamsen&lt;/A&gt; has an excellent 4-hour lecture on Data Modelling where he describes those models in great detail, as part of the &lt;A href="http://www.masterssummit.com/"&gt;Masters Summit for QlikView&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/"&gt;www.naturalsynergies.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 15:51:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Synthetic-Key/m-p/525428#M196390</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-08-23T15:51:29Z</dc:date>
    </item>
  </channel>
</rss>

