<?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: Restrict fields in aggregate function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165920#M914725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may need to add a set expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt; &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to &lt;EM&gt;every&lt;/EM&gt; aggregation function, also to the outer aggregation function of the aggr() (the very first Avg()), implicite Only() functions, and if you are using dollar sign expansions evaluate expressions, also to these expresssion's aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, to show the first few places to check:&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;Avg(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;}&lt;/SPAN&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aggr(&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Isnull(Sum(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;}&lt;/SPAN&gt;Column1)),5,&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Isnull(Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(&lt;SPAN style="color: #ffcc00;"&gt;vMaxMonthMinus2&lt;/SPAN&gt;)'}, &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2= &lt;/STRONG&gt;&lt;/SPAN&gt;&amp;gt;}Column1) /&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(&lt;SPAN style="color: #ffcc00;"&gt;vMaxMonthMinus2&lt;/SPAN&gt;)'},&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;gt;}Column1)),5,&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: 13px;"&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: 13px;"&gt;etc.&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: 13px;"&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: 13px;"&gt;Not sure if you really need it at all places, set analysis is depending on your sets, field values and relation between fields in the model.&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: 13px;"&gt;But to be on the safe side, add the set analysis part to &lt;EM&gt;every&lt;/EM&gt; aggregation function (and don't forget the implicite Only() aggregations and variables).&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: 13px;"&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: 13px;"&gt;edit: I would start with the outer aggregation function (Avg() ) and then check if this already does the job, then add more set expression changes as needed.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 May 2016 09:04:27 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-05-29T09:04:27Z</dc:date>
    <item>
      <title>Restrict fields in aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165919#M914724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg(Aggr(if(Isnull(Sum(Column1)),5,if(Isnull(Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1)),5,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1))=1,5,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1))&amp;gt;=0.99,4,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1))&amp;gt;=0.97,3,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1))&amp;gt;=0.95,2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1) / count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(vMaxMonthMinus2)'}&amp;gt;}Column1))&amp;gt;=0.93,1,0)))))))&lt;/P&gt;&lt;P&gt;,MappingColumn1,MappingColumn2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want that the value doesn't change on selection of MappingColumn2&lt;/P&gt;&lt;P&gt;I have tried&amp;nbsp; 'MappingColumn2=' in the set analysis part but its not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali Gupta&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/Restrict-fields-in-aggregate-function/m-p/1165919#M914724</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict fields in aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165920#M914725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may need to add a set expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt; &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to &lt;EM&gt;every&lt;/EM&gt; aggregation function, also to the outer aggregation function of the aggr() (the very first Avg()), implicite Only() functions, and if you are using dollar sign expansions evaluate expressions, also to these expresssion's aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, to show the first few places to check:&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;Avg(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;}&lt;/SPAN&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aggr(&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Isnull(Sum(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;}&lt;/SPAN&gt;Column1)),5,&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: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Isnull(Sum({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(&lt;SPAN style="color: #ffcc00;"&gt;vMaxMonthMinus2&lt;/SPAN&gt;)'}, &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2= &lt;/STRONG&gt;&lt;/SPAN&gt;&amp;gt;}Column1) /&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count({&amp;lt;Link_Flag={'Link1'},[Call_Year-Month]={'$(&lt;SPAN style="color: #ffcc00;"&gt;vMaxMonthMinus2&lt;/SPAN&gt;)'},&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;gt;}Column1)),5,&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: 13px;"&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: 13px;"&gt;etc.&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: 13px;"&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: 13px;"&gt;Not sure if you really need it at all places, set analysis is depending on your sets, field values and relation between fields in the model.&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: 13px;"&gt;But to be on the safe side, add the set analysis part to &lt;EM&gt;every&lt;/EM&gt; aggregation function (and don't forget the implicite Only() aggregations and variables).&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: 13px;"&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: 13px;"&gt;edit: I would start with the outer aggregation function (Avg() ) and then check if this already does the job, then add more set expression changes as needed.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 09:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165920#M914725</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-05-29T09:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict fields in aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165921#M914726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was missing &lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;MappingColumn2=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; in the variable. Hence, the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 13:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restrict-fields-in-aggregate-function/m-p/1165921#M914726</guid>
      <dc:creator />
      <dc:date>2016-05-30T13:14:42Z</dc:date>
    </item>
  </channel>
</rss>

