<?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: Aggr Count doesn't work in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-Count-doesn-t-work/m-p/1818300#M1213220</link>
    <description>&lt;P&gt;Not sure why it didn't work at the first place, but rather then using GetFieldSelections I opted for GetCurrentSelections.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jun 2021 12:00:42 GMT</pubDate>
    <dc:creator>Kunkulis</dc:creator>
    <dc:date>2021-06-28T12:00:42Z</dc:date>
    <item>
      <title>Aggr Count doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Count-doesn-t-work/m-p/1817922#M1213180</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying&amp;nbsp; to check if there is only empty values in a straight table or there is at least 1 value&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Viewer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Person1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;EM&gt;Empty cell is '' not null&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;So with the example data above, when I select to add a Viewer column to table, I would expect to see:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Viewer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Person1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for the viewer table I use this calculated dimenstion:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(aggr(count(distinct [Viewer]),[ID])=1,[Viewer],
if([Viewer]='',Null(),[Viewer]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my test the formula above works perfectly as it should,&amp;nbsp; but then I add it to my dynamic table, where other things are checked as well, it doesn't work at all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Approver*Editor*Viewer*'),
if([Approver]='' and [Editor]='' and [Viewer]='',Null(),[Viewer]),

if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Editor*Viewer*'),
if([Editor]='' and [Viewer]='',Null(),[Viewer]),

if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Approver*Viewer*'),
if([Approver]='' and [Viewer]='',Null(),[Viewer]),

if(aggr(count(distinct [Viewer]),[ID])=1,[Viewer],
if([Viewer]='',Null(),[Viewer])))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far what I have noticed its the WildMatch and/or GetFieldSelections that is messing it up. Once I add the Aggr part under true or false, it doesn't show the empty cases for the IDs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional info for the table we have.&lt;BR /&gt;In Straight Table we have checked 'Suppress when Value is null' and Enable Conditional:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=substringcount('|'&amp;amp;GetFieldSelections(DetailDim_, '|', 100)&amp;amp;'|','Viewer')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:08:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Count-doesn-t-work/m-p/1817922#M1213180</guid>
      <dc:creator>Kunkulis</dc:creator>
      <dc:date>2021-06-25T13:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr Count doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Count-doesn-t-work/m-p/1818300#M1213220</link>
      <description>&lt;P&gt;Not sure why it didn't work at the first place, but rather then using GetFieldSelections I opted for GetCurrentSelections.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 12:00:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Count-doesn-t-work/m-p/1818300#M1213220</guid>
      <dc:creator>Kunkulis</dc:creator>
      <dc:date>2021-06-28T12:00:42Z</dc:date>
    </item>
  </channel>
</rss>

