<?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: Struggling with aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518313#M437236</link>
    <description>Perhaps this?&lt;BR /&gt;Sum({&amp;lt;Local = {'CA', 'TX'}, month ={'oct'}&amp;gt;} aggr(NoDistinct If(&lt;BR /&gt;Count(DISTINCT {&amp;lt;AsOfPeriod=, NewIndex={"$(=max(_AsOfMonthIndex))"},PeriodType={'Current month'}&amp;gt;}%ProdLocalMarket)&amp;gt;0,&lt;BR /&gt;if((Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}RatingSum)/Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}Reviews))&amp;gt;=4.25,1,0)), AsOfPeriod,ProductID,Market))</description>
    <pubDate>Sun, 09 Dec 2018 12:54:29 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2018-12-09T12:54:29Z</dc:date>
    <item>
      <title>Struggling with aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518298#M437233</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;Well, I have a scenario , where I have to show the count of current month active product in a locale which have a rating above 4.3 across all the months aggregated over market.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So For Ex - So suppose there is a product A which is active in the Locale CA and TX for october&amp;nbsp;under&amp;nbsp;north America and in active&amp;nbsp; under any locale in north america ,&amp;nbsp; so we need to take their rating sum and reviews and calculate their rating and if rating is greater than 4.3 , we would take the count as 1 for whole NA&amp;nbsp; for that product.&amp;nbsp; This product locale combination can be active under any other month as well, so i have to check in other months as well with the same condition and if it satisfies I have to show that count rolled in october month only. so basically it's a accumulated sum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my expression - It checks the prod locale key&amp;nbsp;, but while aggregating as I'm have to do it on the&amp;nbsp; product id, market level it&amp;nbsp;only takes the product&amp;nbsp;&amp;nbsp;and aggregates&amp;nbsp; over all the locale&amp;nbsp;and gives me the count. so I'm getting some extra numbers.&amp;nbsp; Can any one help me ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the table required&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;AsOfPeriod=&amp;gt;}Aggr(if(&lt;BR /&gt;Count(DISTINCT {&amp;lt;AsOfPeriod=, NewIndex={"$(=max(_AsOfMonthIndex))"},PeriodType={'Current month'}&amp;gt;}%ProdLocalMarket)&amp;gt;0,&lt;BR /&gt;if((Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}RatingSum)/Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}Reviews))&amp;gt;=4.25,1,0)),AsOfPeriod,ProductID,Market))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note - All the AsOfPeriod Months are attached to the months below them to have the accumulated view in the period type calendar , also to them as period type current month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Idea is that user can switch between current view and lifetime view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 10:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518298#M437233</guid>
      <dc:creator>Akey_Qlik</dc:creator>
      <dc:date>2018-12-09T10:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518306#M437234</link>
      <description>Initially if you try below one, what will happen&lt;BR /&gt;&lt;BR /&gt;Sum(aggr(If(&lt;BR /&gt;Count(DISTINCT {&amp;lt;AsOfPeriod=, NewIndex={"$(=max(_AsOfMonthIndex))"},PeriodType={'Current month'}&amp;gt;}%ProdLocalMarket)&amp;gt;0,&lt;BR /&gt;if((Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}RatingSum)/Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}Reviews))&amp;gt;=4.25,1,0)), AsOfPeriod,ProductID,Market))</description>
      <pubDate>Sun, 09 Dec 2018 11:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518306#M437234</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-12-09T11:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518311#M437235</link>
      <description>It still considers all the locales for the products in that market if any and then calculate the rating.</description>
      <pubDate>Sun, 09 Dec 2018 11:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518311#M437235</guid>
      <dc:creator>Akey_Qlik</dc:creator>
      <dc:date>2018-12-09T11:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518313#M437236</link>
      <description>Perhaps this?&lt;BR /&gt;Sum({&amp;lt;Local = {'CA', 'TX'}, month ={'oct'}&amp;gt;} aggr(NoDistinct If(&lt;BR /&gt;Count(DISTINCT {&amp;lt;AsOfPeriod=, NewIndex={"$(=max(_AsOfMonthIndex))"},PeriodType={'Current month'}&amp;gt;}%ProdLocalMarket)&amp;gt;0,&lt;BR /&gt;if((Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}RatingSum)/Sum({&amp;lt;AsOfPeriod=,PeriodType={'Current month'}&amp;gt;}Reviews))&amp;gt;=4.25,1,0)), AsOfPeriod,ProductID,Market))</description>
      <pubDate>Sun, 09 Dec 2018 12:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Struggling-with-aggregation/m-p/1518313#M437236</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-12-09T12:54:29Z</dc:date>
    </item>
  </channel>
</rss>

