<?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: Function aggr doesn't return values based on selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440528#M164198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using 'nodistinct' as a keyword just inside the aggr() function ..... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13609382569806515" jivemacro_uid="_13609382569806515"&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM(aggr(NODISTINCT (((SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}EOW_STK_QTY))/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;(SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}Avg_Shpmt)))*5),%WEEK))&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why, but I often need to set this. Reference manual states:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If the expression argument is preceded by the nodistinct qualifier, each combination of dimension values may generate more than one return value, depending on underlying data structure"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Feb 2013 14:24:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-02-15T14:24:11Z</dc:date>
    <item>
      <title>Function aggr doesn't return values based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440527#M164197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I want to use the aggr function to return me the values of Inventory Coverage(IC) from week 1 to Week 4 using filters like, current year, current semester(1 if we are in Week 1 to Week 26 and 2 if we are in Week 27 to Week 52), and where the countries are France, UK, Poland and Spain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have made 2 tests: one which returns me the values of IC for each week based on the filters above and the second test which makes an aggregation and should return me the values of IC from Week1 to Week 4 for countries France, UK, Poland and Spain based on current year and current semester.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Column 3 in the attached table returns me the correct values of IC based on the filters and expression below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;=(SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}EOW_STK_QTY)/SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}Avg_Shpmt))*5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I use the aggr function below(4th column in the attached table), qlikview doesn't return me the values of the IC for each country (France, UK, Spain, Poland) based on current year, current semester:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM(aggr((((SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}EOW_STK_QTY))/(SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}Avg_Shpmt)))*5),%WEEK))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_Report_year = 2013&lt;/P&gt;&lt;P&gt;v_Current_Half= 1 as the data in the qvd are for week 4&lt;/P&gt;&lt;P&gt;v_Filtre_Europe = Cluster Europe, that is, France, O UK, TM UK, Poland, Spain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; It's only returning me values for France and Spain and only for some weeks instead of for weeks 1 to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me on this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 14:15:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440527#M164197</guid>
      <dc:creator />
      <dc:date>2013-02-15T14:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function aggr doesn't return values based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440528#M164198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using 'nodistinct' as a keyword just inside the aggr() function ..... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13609382569806515" jivemacro_uid="_13609382569806515"&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM(aggr(NODISTINCT (((SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}EOW_STK_QTY))/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;(SUM({$&amp;lt;%YEAR={$(v_Report_Year)}, $(v_Filtre_Current_Half), $(v_Filtre_Europe)&amp;gt;}Avg_Shpmt)))*5),%WEEK))&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why, but I often need to set this. Reference manual states:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If the expression argument is preceded by the nodistinct qualifier, each combination of dimension values may generate more than one return value, depending on underlying data structure"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 14:24:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440528#M164198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-15T14:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function aggr doesn't return values based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440529#M164199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least I get values of IC for all the countries. I can now cross check if the expression returns me the values I was expecting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:02:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-aggr-doesn-t-return-values-based-on-selections/m-p/440529#M164199</guid>
      <dc:creator />
      <dc:date>2013-02-18T15:02:21Z</dc:date>
    </item>
  </channel>
</rss>

