<?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: Expression with Aggr() calculates not for all rows in table chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133562#M755641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT contact_id)/count(DISTINCT TOTAL &amp;lt;user_name&amp;gt; contact_id)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;Count(DISTINCT contact_id)/Aggr(NODISTINCT Count(DISTINCT contact_id), user_id)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215158_Capture.PNG" style="height: 169px; width: 620px;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2018 18:44:25 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-10-04T18:44:25Z</dc:date>
    <item>
      <title>Expression with Aggr() calculates not for all rows in table chart</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133561#M755640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;I have a following table chart:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="215048" alt="QV_aggr.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215048_QV_aggr.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;User&lt;/STRONG&gt; is a field user_name;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Frequency&lt;/STRONG&gt; is calculated dimension, which means a number of visits to contacts, made by user in period: Aggr(count(distinct visit_id), contact_id)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Contacts count&lt;/STRONG&gt; is an expression. It shows how many contacts were visited with that frequency: count(distinct contact_id)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test %&lt;/STRONG&gt; should calculate % of contacts, visited with following frequency, of total number of contacts, visited by user. So, the result table should look like this:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;User&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Frequency&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Contacts count&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Test %&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;164&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;164/(164+33) = 0.83&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;33&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;33/(164+33) = 0.17&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150/(150+9) = 0.94&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9/(150+9) = 0.06&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Now for &lt;STRONG&gt;Test %&lt;/STRONG&gt; I use this expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;count(distinct contact_id) /&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; sum(Aggr(count(DISTINCT contact_id), user_id&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; ))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;And as you can see from first picture, it works only for one row per each user. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Is there a way to find this &lt;STRONG&gt;Test %&lt;/STRONG&gt; for all calculated dimensions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sample data and qvw-file are attached.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133561#M755640</guid>
      <dc:creator>mrbalyaqv</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Aggr() calculates not for all rows in table chart</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133562#M755641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT contact_id)/count(DISTINCT TOTAL &amp;lt;user_name&amp;gt; contact_id)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;Count(DISTINCT contact_id)/Aggr(NODISTINCT Count(DISTINCT contact_id), user_id)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215158_Capture.PNG" style="height: 169px; width: 620px;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 18:44:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133562#M755641</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-10-04T18:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Aggr() calculates not for all rows in table chart</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133563#M755642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 19:00:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Aggr-calculates-not-for-all-rows-in-table-chart/m-p/133563#M755642</guid>
      <dc:creator>mrbalyaqv</dc:creator>
      <dc:date>2018-10-04T19:00:23Z</dc:date>
    </item>
  </channel>
</rss>

