<?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: Double sum of OrderLineValue in Linktable datamodel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835165#M1214831</link>
    <description>&lt;P&gt;I suggest to put also a rowno() within the table(s) from which the measures [OrderRegelNettoB...] comes and pulling them also within the straight-table.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 09:16:41 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2021-09-10T09:16:41Z</dc:date>
    <item>
      <title>Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1832907#M1214709</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;We are encountering a problem which we can’t get a grasp on. Currently we are working on a data-model in Qlikview which makes use of a so called: Linktable. The way we built up de linktable is as follows:&lt;/P&gt;&lt;P&gt;LinkTable:&lt;BR /&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; DISTINCT&lt;BR /&gt;FactuurRegelKey,&lt;BR /&gt;ProductKey,&lt;BR /&gt;DebiteurKey,&lt;BR /&gt;OrderRegelKey,&lt;BR /&gt;'VF' as TYPEPeriode,&lt;BR /&gt;FactuurDatum as PeriodeKey,&lt;BR /&gt;Intercompany,&lt;BR /&gt;RepLevelKey,&lt;BR /&gt;VestigingsCode,&lt;BR /&gt;AdministratieNummer,&lt;BR /&gt;AccountManagerNaam&lt;BR /&gt;RESIDENT f_Facturen;&lt;/P&gt;&lt;P&gt;This is repeated for every Fact_table. By including the TYPEPeriode in the set-analysis in all variables we use, we get the correct and expected result. I.e. in the case of the invoice amount, we sum({&amp;lt;TYPEPeriode={‘VF’}&amp;gt;}InvoiceLineValue) and get the result we would expect.&lt;/P&gt;&lt;P&gt;However in the case of the OrderLineValue, we have the following expression 1:&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;TYPEPeriode={'VB'}, OrderDate={"$(='&amp;gt;=' &amp;amp; Date(YearStart((vMaxDate_OrderDate))) &amp;amp; '&amp;lt;=' &amp;amp; Date((vMaxDate_OrderDate)))"}&amp;gt;} OrderLineValue)&lt;/P&gt;&lt;P&gt;We would expect an outcome of €132.30, which is the actual fact.&lt;BR /&gt;But it is giving us €264.60.&lt;BR /&gt;Exactly the double of the expected amount. &amp;nbsp;&lt;/P&gt;&lt;P&gt;And this despite the fact that TYPEPeriode = ‘VB’ is included in the set analysis. We would expect that with this expression we would only get the OrderLineValue associated with the TYPEPeriode = ‘VB’.&lt;/P&gt;&lt;P&gt;See the image below, I selected the OrderRegelKey (OrderLineKey) and I get back 5 rows in the Linktable. However, I get 2 rows with unique keys in the f_Facturen and 1 row in f_Orders. The sum of the OrderLineValue is based on a field only present in the f_Order table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thymenkristen_0-1630502533872.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61137iF24CF42010A5D049/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thymenkristen_0-1630502533872.png" alt="thymenkristen_0-1630502533872.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question:&lt;BR /&gt;Why do I get a double sum of the amount on the OrderLineValue? Is it ignoring my TYPEPeriode field in the set analysis or is there another explanation?&lt;/P&gt;&lt;P&gt;If I construct the expression 2 as follows:&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;TYPEPeriode={'VB'}, OrderDate ={"$(='&amp;gt;=' &amp;amp; Date(YearStart((vMaxDate_ OrderDate))) &amp;amp; '&amp;lt;=' &amp;amp; Date((vMaxDate_ OrderDate)))"}&amp;gt;}aggr( OrderLineValue, OrderRegelKey))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the correct result, however I do not understand why.&lt;BR /&gt;Can someone explain this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 14:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1832907#M1214709</guid>
      <dc:creator>thymenkristen</dc:creator>
      <dc:date>2021-09-01T14:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1833560#M1214746</link>
      <description>&lt;P&gt;I have a similar problem.&lt;BR /&gt;Anyone a idea what is happening here?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 09:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1833560#M1214746</guid>
      <dc:creator>Strooprover</dc:creator>
      <dc:date>2021-09-03T09:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1833836#M1214753</link>
      <description>&lt;P&gt;It seems that either the keys to the link-table aren't&amp;nbsp;created properly and/or that there are duplicated values - maybe some of the merging load-processes aren't distinct. To check if there are duplicates you need to ensure that you have an absolutely unique record-id because all the UI objects in Qlik will display only the distinct combinations of the used fields and you wouldn't see the duplicates. If no such unique id exists you could create one with rowno().&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 13:20:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1833836#M1214753</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-05T13:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835041#M1214814</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My colleague Thymen above opened this topic. I've done some testing and debugging but I am still not able to retrieve the cause of this. A Table Box shows only 1 record, where as a count(&lt;SPAN&gt;OrderLineValue) shows that there are 2. Is there a way to further dive into this, by showing system tables or hidden fields?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards, Sander&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 14:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835041#M1214814</guid>
      <dc:creator>SanderHovestad</dc:creator>
      <dc:date>2021-09-09T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835051#M1214823</link>
      <description>&lt;P&gt;System-tables and/or hidden fields aren't helpful for such use-cases else like above mentioned an unique record-identifier is needed. If none such key exists respectively through various merging-measures like concatenate or joins they aren't unique anymore you could create them with recno() and/or rowno() within all relevant tables. Further helpful is often to put an appropriate source-information within all concatenated tables.&lt;/P&gt;&lt;P&gt;If you now adds the recno(), rowno() and source within the tablebox with your other fields you will see the duplicated data and from where they are und usually this leads quite soon to the why.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 15:10:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835051#M1214823</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-09T15:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835141#M1214827</link>
      <description>&lt;P&gt;Thanks for the hint, however this is not giving any more insights. The straight table still shows that there's 1 record in the Linktable, and the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;count(&lt;/SPAN&gt;&lt;SPAN&gt;OrderLineValue) still shows 2. My gut feeling says the reason that is causing this, is because for this orderline we have 2 invoices. But still, by filtering on TYPEPeriode = VB we exclude the invoice lines.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any more ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 08:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835141#M1214827</guid>
      <dc:creator>SanderHovestad</dc:creator>
      <dc:date>2021-09-10T08:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835145#M1214829</link>
      <description>&lt;P&gt;If you add the mentioned rowno() and source as dimension to the straight-table you will quite probably see that there is more as one record.&lt;/P&gt;&lt;P&gt;Each UI object in Qlik will always display the distinct combination of field-values and therefore you need the record-identifier there.&lt;/P&gt;&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 08:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835145#M1214829</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-10T08:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835158#M1214830</link>
      <description>&lt;P&gt;Hereby the screenshots, which to me give not any more insights.&lt;/P&gt;&lt;P&gt;Below are all Linktable rows, including rowno() and recno()in a Table Box:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SanderHovestad_0-1631264291929.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61690i7F75D0267D7BC61B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SanderHovestad_0-1631264291929.png" alt="SanderHovestad_0-1631264291929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see the last column contains the same value for every TYPEPEriode, which is the correct one.&lt;/P&gt;&lt;P&gt;When filtering only on the VB TYPEPeriode, there is 1 row remaining with again showing the correct amount:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SanderHovestad_1-1631264355184.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61691i515F21432AC0BA71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SanderHovestad_1-1631264355184.png" alt="SanderHovestad_1-1631264355184.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But unfortunately a sum of this column shows the amount * 2 even when including the rowno() and recno() in the straight table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SanderHovestad_1-1631264650061.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61694i0B072359F3E49CCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SanderHovestad_1-1631264650061.png" alt="SanderHovestad_1-1631264650061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm totally lost here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 09:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835158#M1214830</guid>
      <dc:creator>SanderHovestad</dc:creator>
      <dc:date>2021-09-10T09:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835165#M1214831</link>
      <description>&lt;P&gt;I suggest to put also a rowno() within the table(s) from which the measures [OrderRegelNettoB...] comes and pulling them also within the straight-table.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 09:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835165#M1214831</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-10T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835547#M1214861</link>
      <description>&lt;P&gt;Unfortunately no progress on this, despite adding the recordno's.&lt;/P&gt;&lt;P&gt;In the screenshot below you see the single orderline being invoiced twice, where the OrderRegelKey and the OrderRegelRecNo is the same for all records, but is different for the two invoices (TYPEPeriode VF).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SanderHovestad_0-1631532050901.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61790i015BEE0788ED278E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SanderHovestad_0-1631532050901.png" alt="SanderHovestad_0-1631532050901.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also included 3 textboxes that show the counts of the keys and the amount when filtering on TYPEPeriode VB, so you can see we have 1 orderkey, 0 invoice keys but still 2 amounts. Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 11:22:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835547#M1214861</guid>
      <dc:creator>SanderHovestad</dc:creator>
      <dc:date>2021-09-13T11:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835564#M1214863</link>
      <description>&lt;P&gt;I think there is at least one other table which is associated within this view which has duplicate values or caused the duplication because of the way how the key looked like on which the table is linked. Maybe you take the table from TypePeriode as the next.&lt;/P&gt;&lt;P&gt;Before doing this make sure that there is no synthetic key or any circular loop within the datamodel.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 11:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1835564#M1214863</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-13T11:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Double sum of OrderLineValue in Linktable datamodel</title>
      <link>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1845434#M1215447</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;Just wanted to let you know that we have been able to solve the issue. It was indeed caused by a duplicate key, caused by&amp;nbsp; a LEFT JOIN to the invoice table. The only way to find this out, was by bring the Qlik load script down to the bare minimum and one by one add the tables back to the model. This way we found the query that gave the error.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 10:14:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-sum-of-OrderLineValue-in-Linktable-datamodel/m-p/1845434#M1215447</guid>
      <dc:creator>SanderHovestad</dc:creator>
      <dc:date>2021-10-12T10:14:13Z</dc:date>
    </item>
  </channel>
</rss>

