<?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: Sankey Diagram Count Distinct &amp;gt; 100% in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939184#M77415</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62200"&gt;@newuser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would happen if the values that you are getting a distinct count of appear in more than one of the dimension values. If you picture having the following table:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt;"&gt;Dim2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then if you count distinct Dim2 within Dim1 you would have:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD class="xl67"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD class="xl67"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl65" style="height: 15.0pt;"&gt;TOTAL&lt;/TD&gt;
&lt;TD class="xl66"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you then view the dimension values as percentages of the total:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD class="xl68"&gt;100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD class="xl68"&gt;100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl65" style="height: 15.0pt;"&gt;SUM&lt;/TD&gt;
&lt;TD class="xl68"&gt;200%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's obviously an extreme example, but if you have many Dim2 values across Dim1 and a few of them appear in more than one Dim1 values you could end up with a sankey total over 100%.&lt;/P&gt;
&lt;P&gt;If you count distinct a composite value of Dim1 &amp;amp; '-' &amp;amp; Dim2 then that would remove that risk of going over 100%, as a duplicate value would double count in the total, as well as against each dimension.&lt;/P&gt;
&lt;P&gt;Hope that makes sense.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 19:51:49 GMT</pubDate>
    <dc:creator>stevedark</dc:creator>
    <dc:date>2022-06-02T19:51:49Z</dc:date>
    <item>
      <title>Sankey Diagram Count Distinct &gt; 100%</title>
      <link>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939008#M77392</link>
      <description>&lt;P&gt;I've seen a few posts mentioning Sankey diagrams resulting in more than 100%. Has anyone encountered this, and if so, what is the reason it happens? We've found depending on the dimensions used, the %'s change, e.g., using two vs. three dimensions in the Sankey can vary the parent %'s shown. We are counting distinct and then dividing by the "total".&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 14:28:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939008#M77392</guid>
      <dc:creator>newuser</dc:creator>
      <dc:date>2022-06-02T14:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sankey Diagram Count Distinct &gt; 100%</title>
      <link>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939184#M77415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62200"&gt;@newuser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would happen if the values that you are getting a distinct count of appear in more than one of the dimension values. If you picture having the following table:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt;"&gt;Dim2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then if you count distinct Dim2 within Dim1 you would have:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD class="xl67"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD class="xl67"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl65" style="height: 15.0pt;"&gt;TOTAL&lt;/TD&gt;
&lt;TD class="xl66"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you then view the dimension values as percentages of the total:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Dim1&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD class="xl68"&gt;100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;B&lt;/TD&gt;
&lt;TD class="xl68"&gt;100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl65" style="height: 15.0pt;"&gt;SUM&lt;/TD&gt;
&lt;TD class="xl68"&gt;200%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's obviously an extreme example, but if you have many Dim2 values across Dim1 and a few of them appear in more than one Dim1 values you could end up with a sankey total over 100%.&lt;/P&gt;
&lt;P&gt;If you count distinct a composite value of Dim1 &amp;amp; '-' &amp;amp; Dim2 then that would remove that risk of going over 100%, as a duplicate value would double count in the total, as well as against each dimension.&lt;/P&gt;
&lt;P&gt;Hope that makes sense.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 19:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939184#M77415</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2022-06-02T19:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sankey Diagram Count Distinct &gt; 100%</title>
      <link>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939229#M77421</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;! When using the composite field, would that preclude me from using multiple separate dimensions in the Sankey? In my case, I do have instances where multiple Dim2's reside in a Dim1.&lt;/P&gt;
&lt;P&gt;I'd still like to use Dim2, Dim1 as separate dimensions in the Sankey, so I am assuming your composite key suggestion would still allow for that?&lt;/P&gt;
&lt;P&gt;Would the composite field be in the highest-level parent field only (left-most field) or any parent field needing child fields grouped (if that makes sense)?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 00:03:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939229#M77421</guid>
      <dc:creator>newuser</dc:creator>
      <dc:date>2022-06-03T00:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sankey Diagram Count Distinct &gt; 100%</title>
      <link>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939310#M77429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62200"&gt;@newuser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to create it as a field, or add it to a dimension, just reference the composite value in the Measure of the sankey chart:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;count(DISTINCT Dim1 &amp;amp; '-' &amp;amp; Dim2)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If both Dim1 and Dim2 exist in the same source table then you can make your app more efficient by concatenating on load to a new field that you can reference in the count.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 07:36:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sankey-Diagram-Count-Distinct-gt-100/m-p/1939310#M77429</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2022-06-03T07:36:58Z</dc:date>
    </item>
  </channel>
</rss>

