<?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: Count of rows using aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477378#M1122177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Nicole, my apologies...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jan 2014 18:51:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-01-07T18:51:46Z</dc:date>
    <item>
      <title>Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477374#M1122173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table as below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); 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;Retail(Managers)&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KPI1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KPI2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KPI1/KPI2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Grade&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Anu&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Manka&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;430&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.69&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Tunai&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.66&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Ruku&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;450&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.44&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Payel&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The First column is a cyclic group named Retail. The cyclic group is defined as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; Region----&amp;gt;Zone---&amp;gt;Managers---&amp;gt;Field Employee----&amp;gt;Store. &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;Store is the lowest level in the hierarchy of cyclic group. The logic for the above table is simple. If KPI1/KPI2 is equal to 0.5 then Grade= B, if Greater then A else C.&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;I have pre-selected the Zone named as US East in the list box.&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;&lt;STRONG&gt;I need to display a table as below&lt;/STRONG&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); 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;Retail(Zone)&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Number of A&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Number of B&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Number of C&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;US East&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;So,all the above Managers belonged to the Zone named as US East. When I cycle up in the Cyclic group to show Zone, I should see the count of Managers under that Zone having A, B or C. Similarly for other Zones as well.&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;I have used this expression with no luck:&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;If&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;getcurrentfield([Retail])='Zone' ,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;count&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; If&lt;/P&gt;&lt;P&gt;&amp;nbsp; (KPI1/KPI2)=-0.5,1),MANAGER_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) ,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;getcurrentfield([Retail])='Managers' ,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;count&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; If&lt;/P&gt;&lt;P&gt;&amp;nbsp; (KPI1/KPI2)=-0.5,1),FIELD_EMPLOYEE_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ))&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&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; font-size: 10pt; line-height: 1.5em;"&gt;Appreciate your help to determine the issue and help with a working solution to achieve the result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&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; font-size: 10pt; line-height: 1.5em;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Tutan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477374#M1122173</guid>
      <dc:creator />
      <dc:date>2014-01-07T18:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477375#M1122174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please do not post the same question multiple times.&amp;nbsp; The original thread is being replied to here: &lt;A href="https://community.qlik.com/thread/103341"&gt;Expression help&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477375#M1122174</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-07T18:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477376#M1122175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tutan,&lt;/P&gt;&lt;P&gt;This is just a suggestion. Dunno if it will be applicable for your case.&lt;/P&gt;&lt;P&gt;Why don't you create a flag in the backend like Grade using the same logic you are using on the front end. Once you have the flag all you have to do is use an &lt;STRONG&gt;If condition &lt;/STRONG&gt; and count the flag for those three expressions in the second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if it was helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477376#M1122175</guid>
      <dc:creator />
      <dc:date>2014-01-07T18:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477377#M1122176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AJ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like the idea. But, I want to know where is the issue here. Just wanted to save some time in writing a new piece of code. I have a feeling that selection in the cyclic group is a problem here. I have used a similar kind of an expression by omitting the cyclic group selection part, just for counting number of store and it just worked fine across hierarchies.Just curious to know where am I doing it incorrectly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tutan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:51:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477377#M1122176</guid>
      <dc:creator />
      <dc:date>2014-01-07T18:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477378#M1122177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Nicole, my apologies...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:51:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477378#M1122177</guid>
      <dc:creator />
      <dc:date>2014-01-07T18:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477379#M1122179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem, Tutan.&amp;nbsp; Questions are easier to answer when having the entirety of the information, which someone would be missing had they not read the other thread.&amp;nbsp; It just makes it easier if everything is in one place &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:53:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477379#M1122179</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-07T18:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Count of rows using aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477380#M1122181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason I suggested back end calculation is because the If condition on front end is resource intensive so it could have some impact on performance.&lt;/P&gt;&lt;P&gt;But if you wanna use it on Front end, please try this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetCurrentField([Retail])='Zone', count(if(aggr(((KPI1)/(KPI2)),Managers)&amp;gt;.5,1)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just moved If and aggr around and this is only for A. You can do the same for the remaining two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a sample file. Also please note that the second table will work only when the Group is 'Zone'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 19:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-rows-using-aggr/m-p/477380#M1122181</guid>
      <dc:creator />
      <dc:date>2014-01-07T19:41:15Z</dc:date>
    </item>
  </channel>
</rss>

