<?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 Counting With Aggregation with overlap in dimension values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786614#M1210111</link>
    <description>&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV21.PNG" style="width: 237px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49961i0631FD00EFE1E3DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV21.PNG" alt="commQV21.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 14:03:24 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2021-02-26T14:03:24Z</dc:date>
    <item>
      <title>Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786354#M1210088</link>
      <description>&lt;P&gt;Hello folks, Need some help to fix&amp;nbsp; an issue in production. Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;I am trying to figure to suppress double counting of&amp;nbsp; a dimension value.&amp;nbsp; Attaching screen shot explaining the issue.&lt;/P&gt;&lt;P&gt;Have the source data loaded as below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Soource&amp;nbsp; Data :&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;pid&lt;/TD&gt;&lt;TD&gt;tin&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p1&lt;/TD&gt;&lt;TD&gt;t1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p1&lt;/TD&gt;&lt;TD&gt;t2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p2&lt;/TD&gt;&lt;TD&gt;t1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p3&lt;/TD&gt;&lt;TD&gt;t2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p4&lt;/TD&gt;&lt;TD&gt;t2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p5&lt;/TD&gt;&lt;TD&gt;t3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p6&lt;/TD&gt;&lt;TD&gt;t3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;p7&lt;/TD&gt;&lt;TD&gt;t3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The requirement is&amp;nbsp; for each of pid,&amp;nbsp;&lt;STRONG&gt;RelatedPIDS&lt;/STRONG&gt;&amp;nbsp; should be&amp;nbsp;computed via tin and through the tin against pid get other pids and show as count including current pid.&amp;nbsp; I am double counting for pid p1&amp;nbsp; since it shared to tins&amp;nbsp; t1 and t2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the expression&amp;nbsp; to compute RelatedPIDS field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum( Aggr(NODISTINCT count( distinct {1&amp;lt;tin={"*"} &amp;gt;}pid),tin))&amp;nbsp;&lt;/P&gt;&lt;P&gt;For pid p1, it is double counting since it has overlap with tin t1 and t2. I am getting count of 5 instead of 4 since p1 is counted twice which is shared with tin t1 and t2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one suggest how to suppress double count?&amp;nbsp; Example data attached below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShotExample.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49910iD72052B902CB5F94/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenShotExample.png" alt="ScreenShotExample.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 20:42:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786354#M1210088</guid>
      <dc:creator>gopal5879</dc:creator>
      <dc:date>2021-02-25T20:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786428#M1210091</link>
      <description>&lt;P&gt;mapSource:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;BR /&gt;tin,&lt;BR /&gt;concat(pid,',') as t&lt;BR /&gt;group by tin;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;BR /&gt;pid, tin&lt;BR /&gt;p1, t1&lt;BR /&gt;p1, t2&lt;BR /&gt;p2, t1&lt;BR /&gt;p3, t2&lt;BR /&gt;p4, t2&lt;BR /&gt;p5, t3&lt;BR /&gt;p6, t3&lt;BR /&gt;p7, t3&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;s1:&lt;BR /&gt;Load pid,&lt;BR /&gt;subfield(t1,',') as t2;&lt;BR /&gt;Load pid,&lt;BR /&gt;tin,&lt;BR /&gt;ApplyMap('mapSource',tin,null()) as t1;&lt;BR /&gt;Load * Inline [&lt;BR /&gt;pid, tin&lt;BR /&gt;p1, t1&lt;BR /&gt;p1, t2&lt;BR /&gt;p2, t1&lt;BR /&gt;p3, t2&lt;BR /&gt;p4, t2&lt;BR /&gt;p5, t3&lt;BR /&gt;p6, t3&lt;BR /&gt;p7, t3&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the front end&lt;/P&gt;&lt;P&gt;dim:Pid&lt;/P&gt;&lt;P&gt;measure: count(distinct t2)&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 04:53:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786428#M1210091</guid>
      <dc:creator>PriyankaShivhare</dc:creator>
      <dc:date>2021-02-26T04:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786612#M1210110</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
    pid, tin
    p1, t1
    p1, t2
    p2, t1
    p3, t2
    p4, t2
    p5, t3
    p6, t3
    p7, t3
];

Left Join(tab1)
LOAD tin, pid As pid2
Resident tab1;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786612#M1210110</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-26T14:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786614#M1210111</link>
      <description>&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV21.PNG" style="width: 237px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49961i0631FD00EFE1E3DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV21.PNG" alt="commQV21.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:03:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1786614#M1210111</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-26T14:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1787200#M1210185</link>
      <description>&lt;P&gt;Hello Saran,&lt;/P&gt;&lt;P&gt;My approach using set analysis with nested aggregation did not work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Your solution works, Many thanks. Appreciate your time and timely help.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1787200#M1210185</guid>
      <dc:creator>gopal5879</dc:creator>
      <dc:date>2021-03-01T19:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Double Counting With Aggregation with overlap in dimension values</title>
      <link>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1787202#M1210186</link>
      <description>&lt;P&gt;Hello Priyanka,&lt;/P&gt;&lt;P&gt;My approach using set analysis with nested aggregation did not work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Your solution works, Many thanks to you and Saran. Appreciate your time and timely help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Double-Counting-With-Aggregation-with-overlap-in-dimension/m-p/1787202#M1210186</guid>
      <dc:creator>gopal5879</dc:creator>
      <dc:date>2021-03-01T19:33:55Z</dc:date>
    </item>
  </channel>
</rss>

