<?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 Question on limiting record set from expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Question-on-limiting-record-set-from-expression/m-p/61932#M510912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match($(Choice)),0,1),&lt;/P&gt;&lt;P&gt;AGGR(Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;}TOTAL_ROLL_UP_COUNT),MANAGER),&lt;/P&gt;&lt;P&gt;AGGR(Count({&amp;lt;$(vSelectionSpan)&amp;gt;} Distinct EMPLOYEE_ID_Span_Layers),MANAGER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to limit the records where the TOTAL_ROLL_UP_COUNT per MANAGER is &amp;lt;=2&amp;nbsp; (for first line)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;or the distinct EMPLOYEE_ID_Span_Layers &amp;lt;=2&amp;nbsp; per manager (for second line)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I came up with this, this gives me the right result set, but I need to come up with just 1 NUMBER&amp;nbsp; - which is the MANAGER count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My dimensions are Year/Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match($(Choice),0,1),&lt;/P&gt;&lt;P&gt;AGGR(Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;}TOTAL_ROLL_UP_COUNT)&amp;lt;=2,MANAGER),&lt;/P&gt;&lt;P&gt;AGGR(Count({&amp;lt;$(vSelectionSpan)&amp;gt;} Distinct EMPLOYEE_ID_Span_Layers)&amp;lt;=2,MANAGER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Apr 2018 07:49:00 GMT</pubDate>
    <dc:creator>gerrycastellino</dc:creator>
    <dc:date>2018-04-19T07:49:00Z</dc:date>
    <item>
      <title>Question on limiting record set from expression</title>
      <link>https://community.qlik.com/t5/QlikView/Question-on-limiting-record-set-from-expression/m-p/61932#M510912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match($(Choice)),0,1),&lt;/P&gt;&lt;P&gt;AGGR(Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;}TOTAL_ROLL_UP_COUNT),MANAGER),&lt;/P&gt;&lt;P&gt;AGGR(Count({&amp;lt;$(vSelectionSpan)&amp;gt;} Distinct EMPLOYEE_ID_Span_Layers),MANAGER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to limit the records where the TOTAL_ROLL_UP_COUNT per MANAGER is &amp;lt;=2&amp;nbsp; (for first line)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;or the distinct EMPLOYEE_ID_Span_Layers &amp;lt;=2&amp;nbsp; per manager (for second line)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I came up with this, this gives me the right result set, but I need to come up with just 1 NUMBER&amp;nbsp; - which is the MANAGER count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My dimensions are Year/Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match($(Choice),0,1),&lt;/P&gt;&lt;P&gt;AGGR(Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;}TOTAL_ROLL_UP_COUNT)&amp;lt;=2,MANAGER),&lt;/P&gt;&lt;P&gt;AGGR(Count({&amp;lt;$(vSelectionSpan)&amp;gt;} Distinct EMPLOYEE_ID_Span_Layers)&amp;lt;=2,MANAGER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 07:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-on-limiting-record-set-from-expression/m-p/61932#M510912</guid>
      <dc:creator>gerrycastellino</dc:creator>
      <dc:date>2018-04-19T07:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question on limiting record set from expression</title>
      <link>https://community.qlik.com/t5/QlikView/Question-on-limiting-record-set-from-expression/m-p/61933#M510913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pick(Match($(Choice), 0, 1),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(If(Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;} TOTAL_ROLL_UP_COUNT) &amp;lt;= 2, Sum({&amp;lt;%MAIN_ORG_SpanSumm = {$(vL2MainOrg)}&amp;gt;} TOTAL_ROLL_UP_COUNT)), MANAGER),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Aggr(If(Count({&amp;lt;$(vSelectionSpan)&amp;gt;} DISTINCT EMPLOYEE_ID_Span_Layers) &amp;lt;= 2, Count({&amp;lt;$(vSelectionSpan)&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DISTINCT&lt;/SPAN&gt; EMPLOYEE_ID_Span_Layers)), MANAGER))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:24:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-on-limiting-record-set-from-expression/m-p/61933#M510913</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-19T11:24:05Z</dc:date>
    </item>
  </channel>
</rss>

