<?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 and Current Selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397699#M809423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think of aggr as a table... so essentially this is what you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimensions&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcedureID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Patient&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Count(DISTINCT Date)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will filter based on your selections, right? But if you use Count({1} DISTINCT Date) it won't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you are using this in a text box&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(Count({1} DISTINCT Date), Date, ProcedureID, Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the inner expression doesn't filter, but the outer one is unrestricted and will filter based on selections unless you add {1}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Oct 2017 13:59:17 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-10-19T13:59:17Z</dc:date>
    <item>
      <title>AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397694#M809418</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 variable to which this formula has been assigned:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(AGGR( COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The initial screen shows the right count but it also changes when I change my selection criteria.&amp;nbsp; How do keep it&lt;/P&gt;&lt;P&gt;from changing?&amp;nbsp; I thought "{1}" is for the entire application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397694#M809418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397695#M809419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be use here too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&lt;STRONG&gt;{1}&lt;/STRONG&gt; AGGR( COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:41:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397695#M809419</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-19T13:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397696#M809420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(&lt;SPAN style="color: #ff0000;"&gt;{1}&lt;/SPAN&gt; Aggr(Count({1} DISTINCT Date), Date, ProcedureID, Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:41:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397696#M809420</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-19T13:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397697#M809421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems you need do not change in the value of expression then it is working try ths also&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; font-size: 13px;"&gt;SUM(&lt;STRONG&gt;{1} &lt;/STRONG&gt;AGGR( COUNT( &lt;STRONG&gt;{1}&lt;/STRONG&gt; DISTINCT Date), Date, ProcedureID, Patient))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:41:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397697#M809421</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2017-10-19T13:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397698#M809422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding {1} to the SUM command works.&amp;nbsp;&amp;nbsp; So I did a quick experiment by placing the {1} at &lt;/P&gt;&lt;P&gt;different spots.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( AGGR(&amp;nbsp; COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;SUM( AGGR( {1} COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;SUM( {1} AGGR( COUNT( DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( {1} AGGR( {1} COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;SUM( {1} AGGR( COUNT( {1} DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first 3 did not work while the last 2 worked.&amp;nbsp; Logically speaking, I would think you&lt;/P&gt;&lt;P&gt;only need to have one occurrence of "{1}" perhaps at the SUM() level since that's the "outer" &lt;/P&gt;&lt;P&gt;most command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone explain the reason for those three lines that aren't working?&amp;nbsp; Just wanted&lt;/P&gt;&lt;P&gt;to know how QV works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:54:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397698#M809422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-19T13:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397699#M809423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think of aggr as a table... so essentially this is what you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimensions&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcedureID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Patient&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Count(DISTINCT Date)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will filter based on your selections, right? But if you use Count({1} DISTINCT Date) it won't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you are using this in a text box&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(Count({1} DISTINCT Date), Date, ProcedureID, Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the inner expression doesn't filter, but the outer one is unrestricted and will filter based on selections unless you add {1}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397699#M809423</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-19T13:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397700#M809424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK.&amp;nbsp; If AGGR is a table.&amp;nbsp; Then why wouldn't this work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( AGGR( {1} COUNT( DISTINCT Date), Date, ProcedureID, Patient) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isn't this saying for the given table (AGGR), use all the available data then do a SUM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 14:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397700#M809424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-19T14:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397701#M809425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am very good with writing database queries but I just need to figure out how to translate that into&lt;/P&gt;&lt;P&gt;QV syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 14:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397701#M809425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-19T14:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397702#M809426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But both your inner expression and outer expression are not ignoring selections... but do you think by just adding it to Aggr() it would ignore? Also, Set analysis in Aggr() is a recent thing... so I have not played around with it a lot.... As a general rule of thumb.... if I am ignoring selections, I would add {1} to anywhere I see Avg, Min, Max, Median, Sum, Mode, Concat... etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 14:12:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397702#M809426</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-19T14:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397703#M809427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will definitely keep your suggestions in mind when it comes to these things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it wouldn't hurt by placing a "{1}" in every set type operations.&amp;nbsp; The 4th line up there worked for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 14:41:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397703#M809427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-19T14:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR and Current Selection</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397704#M809428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that &lt;A href="https://community.qlik.com/qlik-users/3540"&gt;pcammaert&lt;/A&gt;‌ is responding to some questions and he might be a good person to take advice from.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 14:47:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-and-Current-Selection/m-p/1397704#M809428</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-19T14:47:08Z</dc:date>
    </item>
  </channel>
</rss>

