<?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: Filter for calculated value of expression (problem with aggr()-function) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filter-for-calculated-value-of-expression-problem-with-aggr/m-p/1845464#M1215452</link>
    <description>&lt;P&gt;I corrected the following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) &amp;lt;&amp;gt; 1&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) = 0&lt;/LI-CODE&gt;&lt;P&gt;altough I do not fully understand the reason, because there are only the possible values 0 and 1 and it shouldn't make a difference.&lt;/P&gt;&lt;P&gt;But the aggr()-function sometimes does magic stuff.&lt;/P&gt;&lt;P&gt;So for some documentation I'll leave this here&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 11:04:26 GMT</pubDate>
    <dc:creator>steasy</dc:creator>
    <dc:date>2021-10-12T11:04:26Z</dc:date>
    <item>
      <title>Filter for calculated value of expression (problem with aggr()-function)</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-for-calculated-value-of-expression-problem-with-aggr/m-p/1845442#M1215448</link>
      <description>&lt;P&gt;Hi! I'm using an expression in a Listbox L with multiple aggr()'s like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(account.activated = 'yes' and aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) &amp;lt;&amp;gt; 1 or aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) = 1 and account.activated = 'no', 'Not usable',
if(account.activated = 'yes' aggr(max({$}account.policy), user.id) = 1, 'Usable'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm doing here is to check:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;is the account of an user activated, but haven't accepted the terms of use? &lt;STRONG&gt;OR&lt;/STRONG&gt;&amp;nbsp;has he accepted the terms of use, but the account is not activated?&amp;nbsp;&lt;SPAN&gt;→ mark it as 'Not usable'&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;is the account activated and did the user accept the terms of use?&amp;nbsp;→ mark it as 'Usable'&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;note: the $-sign, which I probably need is destructing my Tablebox T (occuring in the following text)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;What I'm getting is Listbox L with two fields 'Usable' and 'Not usable'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next step I did was creating a Tablebox T with the user.id and a column 'Usable?' with a similar expression.&lt;/P&gt;&lt;P&gt;It's not a problem to filter in Listbox L between 'Usable' and 'Not usable' user accounts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The strange problem is:&lt;/STRONG&gt; If I'm selecting multiple (let's say 5) user.id's at first, it shows me the user.id's in column 1 and if their account is usable or not in column 'Usable?'. I'm able to press on my button 'Usable' from Listbox L and it only shows me 3 of 5 user.id's that are usable indeed. &lt;STRONG&gt;But&lt;/STRONG&gt;&amp;nbsp;if I'm pressing on my button 'Not usable' from Listbox L, it deselects my current selection and shows me &lt;STRONG&gt;all&lt;/STRONG&gt; user.id's in my Tablebox T, that are not usable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My assumption is, that I'm mixing something with the double aggr()-function, that I do not understand. Is there a mistake I fail to understand or are there any other ways to filter in my Tablebox T for 'Usable' and 'Not usable' after selecting multiple user.id's at first?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance (and for reading)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 10:32:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-for-calculated-value-of-expression-problem-with-aggr/m-p/1845442#M1215448</guid>
      <dc:creator>steasy</dc:creator>
      <dc:date>2021-10-12T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter for calculated value of expression (problem with aggr()-function)</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-for-calculated-value-of-expression-problem-with-aggr/m-p/1845464#M1215452</link>
      <description>&lt;P&gt;I corrected the following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) &amp;lt;&amp;gt; 1&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;aggr(max({&amp;lt;user.id&amp;gt;}account.policy), user.id) = 0&lt;/LI-CODE&gt;&lt;P&gt;altough I do not fully understand the reason, because there are only the possible values 0 and 1 and it shouldn't make a difference.&lt;/P&gt;&lt;P&gt;But the aggr()-function sometimes does magic stuff.&lt;/P&gt;&lt;P&gt;So for some documentation I'll leave this here&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-for-calculated-value-of-expression-problem-with-aggr/m-p/1845464#M1215452</guid>
      <dc:creator>steasy</dc:creator>
      <dc:date>2021-10-12T11:04:26Z</dc:date>
    </item>
  </channel>
</rss>

