<?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: Data Model Best Practice to Prevent Loops in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138306#M631843</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;how about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2016 09:06:42 GMT</pubDate>
    <dc:creator>Mark_Little</dc:creator>
    <dc:date>2016-08-05T09:06:42Z</dc:date>
    <item>
      <title>Data Model Best Practice to Prevent Loops</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138305#M631842</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;I am having difficulties setting up a data model as I was continuously getting loop errors. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have 4 different tables which I am loading at the moment which you can see below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The goal of this application is to be able to see the sales per product ID (Quantity field from salesFact) and also compare these sales against the sales target (Target Quantity from salesTarget). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The only way I have got this to work so far is creating a mapping load and mapping the Product Group 1 and Product Group 2 into the salesFact table, however this does not feel like the best approach as the Product ID -&amp;gt; Product Group 1 &amp;amp; 2 relationships are known to change so this means I will often have to continuously map historical data which would not lead to QVD optimized loads. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Does anyone have a better approach for my data model? I have attached a sample excel file and a test QVD document. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 71px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="71"&gt;&lt;STRONG&gt;salesFact:&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Country&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Quantity&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 130px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="130"&gt;&lt;STRONG&gt;productDimensions:&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Family&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Group 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Group 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Supplier&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 135px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="135"&gt;&lt;STRONG&gt;calendarDimensions:&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Quarter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Year&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 107px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="107"&gt;&lt;STRONG&gt;salesTarget&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Country&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Group 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Product Group 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Target Quantity&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Script so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Mapping tables for Product Groups&lt;/P&gt;&lt;P&gt;productGroupOneMap:&lt;/P&gt;&lt;P&gt;Mapping LOAD [Product ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 1]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is productDimensions);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;productGroupTwoMap:&lt;/P&gt;&lt;P&gt;Mapping LOAD [Product ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 2]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is productDimensions);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calendarDimensions:&lt;/P&gt;&lt;P&gt;LOAD Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarter, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is calendarDimensions);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;productDimensions:&lt;/P&gt;&lt;P&gt;LOAD [Product ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Family], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 1], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 2], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Supplier]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is productDimensions);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;salesFact:&lt;/P&gt;&lt;P&gt;LOAD Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('productGroupOneMap', [Product ID], null()) as [Product Group 1],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('productGroupOneMap', [Product ID], null()) as [Product Group 2],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is salesFact);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;salesTarget:&lt;/P&gt;&lt;P&gt;LOAD Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 1], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product Group 2],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Target Quantity]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[QlikDMTest.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is salesTarget);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 08:38:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138305#M631842</guid>
      <dc:creator>rileymd88</dc:creator>
      <dc:date>2016-08-05T08:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Best Practice to Prevent Loops</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138306#M631843</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;how about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 09:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138306#M631843</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2016-08-05T09:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Best Practice to Prevent Loops</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138307#M631844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. This works, however it is similar to what I have implemented so far (but a bit more cleaned up by creating one key). Is this the only way I can get my model to work? As I mentioned above I would like to stay away from having to use ApplyMap to populate the productDimension data as the relationships have been known to change frequently (which means I will always have to ensure I reload a lot of history to ensure the key is correct).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course this could be the only way due to the tricky scenario I have, but I just wanted to check this before building the document further. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 10:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138307#M631844</guid>
      <dc:creator>rileymd88</dc:creator>
      <dc:date>2016-08-05T10:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Best Practice to Prevent Loops</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138308#M631845</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;Another option would looking to joining your product and target to you fact table.&lt;/P&gt;&lt;P&gt;So load the sales fact first, then join the Product table and finally the target. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 11:19:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Best-Practice-to-Prevent-Loops/m-p/1138308#M631845</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2016-08-05T11:19:03Z</dc:date>
    </item>
  </channel>
</rss>

