<?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 AGGR function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575889#M1106985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! I have the following question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Pivot table with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DIMENSION Category&lt;/LI&gt;&lt;LI&gt;DIMENSION Account &lt;STRONG&gt;(***)&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;DIMENSION Office&lt;/LI&gt;&lt;LI&gt;EXPRESSION &lt;STRONG&gt;# Attentions&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where in &lt;STRONG&gt;# Attentions&lt;/STRONG&gt; I want to count if &lt;STRONG&gt;# Attentions&lt;/STRONG&gt; is &amp;gt; 1 (for the corresponding Category and Account)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(***)&lt;/STRONG&gt; I have this calculated dimension and it works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, ACCOUNTID) &amp;gt; 1, ACCOUNTID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I'd like to add the following logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF (CATEGORY = 'OTHERS', PERSONID, ACCOUNTID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I need to use the Person ID when the Category is Others, insted of the Account ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;ACCOUNTID&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;ACCOUNTID&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;PERSONID&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;PERSONID&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I do that? Is there any way to use a variable to know if Category is Others or not and put it there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;variable&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;variable&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Mar 2014 12:43:59 GMT</pubDate>
    <dc:creator>microwin88x</dc:creator>
    <dc:date>2014-03-14T12:43:59Z</dc:date>
    <item>
      <title>AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575889#M1106985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! I have the following question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Pivot table with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DIMENSION Category&lt;/LI&gt;&lt;LI&gt;DIMENSION Account &lt;STRONG&gt;(***)&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;DIMENSION Office&lt;/LI&gt;&lt;LI&gt;EXPRESSION &lt;STRONG&gt;# Attentions&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where in &lt;STRONG&gt;# Attentions&lt;/STRONG&gt; I want to count if &lt;STRONG&gt;# Attentions&lt;/STRONG&gt; is &amp;gt; 1 (for the corresponding Category and Account)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(***)&lt;/STRONG&gt; I have this calculated dimension and it works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, ACCOUNTID) &amp;gt; 1, ACCOUNTID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I'd like to add the following logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF (CATEGORY = 'OTHERS', PERSONID, ACCOUNTID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I need to use the Person ID when the Category is Others, insted of the Account ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;ACCOUNTID&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;ACCOUNTID&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;PERSONID&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;PERSONID&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I do that? Is there any way to use a variable to know if Category is Others or not and put it there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, &lt;STRONG&gt;variable&lt;/STRONG&gt;) &amp;gt; 1, &lt;STRONG&gt;variable&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 12:43:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575889#M1106985</guid>
      <dc:creator>microwin88x</dc:creator>
      <dc:date>2014-03-14T12:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575890#M1106986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you load your sample file or apps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 12:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575890#M1106986</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-03-14T12:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575891#M1106987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, a sample app would be helpful.&amp;nbsp; For now, try this:&lt;/P&gt;&lt;P&gt;if(CATEGORY = 'OTHERS',&lt;/P&gt;&lt;P&gt; IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, PERSONID) &amp;gt; 1, PERSONID)&lt;/P&gt;&lt;P&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(AGGR(COUNT (DISTINCT TD_ENTRY_ID), CATEGORY, ACCOUNTID) &amp;gt; 1, ACCOUNTID)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 13:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575891#M1106987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-14T13:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575892#M1106988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest that you set this in script, so during your load of the relevant table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (CATEGORY = 'OTHERS', PERSONID, ACCOUNTID) As LOOKUPID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;And now just use LOOKUPID as the dimension and in your aggr function without conditionals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jonathan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 13:50:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575892#M1106988</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-03-14T13:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575893#M1106989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent! It worked! Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 14:18:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function/m-p/575893#M1106989</guid>
      <dc:creator>microwin88x</dc:creator>
      <dc:date>2014-03-14T14:18:20Z</dc:date>
    </item>
  </channel>
</rss>

