<?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: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605409#M44819</link>
    <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Many thanks for your help. This works like charm. Although I'm not so sure why an additional aggregation is required for the chart. Is it because 2 dimensions are involved?&lt;/P&gt;&lt;P&gt;I have a follow-up question. With the cumulative average rating calculated, I would like to keep the value regardless of the review month selected by user. I tried to add set modifier in following way, but it didn't work out as I expected.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(

  RangeSum(Above(Sum({&amp;lt;review_month=&amp;gt;} Agg(DISTINCT review_rating, review_id)), 0, RowNo()))
  /
  RangeSum(Above(Count({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo()))

, product, (review_month, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;Any tips on how i can make it work?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2019 05:09:05 GMT</pubDate>
    <dc:creator>qliksensedlin</dc:creator>
    <dc:date>2019-07-24T05:09:05Z</dc:date>
    <item>
      <title>Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604403#M44739</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a data set that contains product reviews and their respective ratings (1 to 5). I'd like to create a chart to display the cumulative average rating trend by each product.&lt;/P&gt;&lt;P&gt;Here is the expression I used to calculate the cumulative average rating:&lt;/P&gt;&lt;P&gt;RangeSum(Above(Sum(Agg(DISTINCT review_rating, review_id)), 0, RowNo()))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;RangeSum(Above(Count(DISTINCT review_id), 0, RowNo()))&lt;/P&gt;&lt;P&gt;As I have the same reviews spanning across multiple rows, I need to take the distinct reviews with their ratings.&lt;/P&gt;&lt;P&gt;This expression works fine when I try it in a table. It calculates the correct cumulative average rating for different products for me. However, it is not working when I add it to my line chart. The same expression will just give me the monthly average rating instead. No cumulation happens.&lt;/P&gt;&lt;P&gt;My line chart has MonthName(review_date) as the Group and product_name as the bar.&lt;/P&gt;&lt;P&gt;Thanks in advance for any tips and help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 20:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604403#M44739</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2021-12-22T20:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604616#M44753</link>
      <description>&lt;P&gt;Would you be able to share a sample where we can see the issue?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 12:47:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604616#M44753</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-22T12:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604894#M44771</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;I have added the screenshot of table and chart here.&lt;/P&gt;&lt;P&gt;You can see that the last column in table calculates the cumulative review rating using the expression I mentioned. However, when the same expression is used in chart the results are different. It appears to calculate the monthly average rating instead as shown in the 5th column in my table.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15864iE2B5DBF6E37A764C/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.JPG" alt="table.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chart.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15863i6C00677046866E64/image-size/large?v=v2&amp;amp;px=999" role="button" title="chart.JPG" alt="chart.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 02:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1604894#M44771</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2019-07-23T02:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605093#M44784</link>
      <description>&lt;P&gt;First thing first, create a new field in the script for &lt;STRONG&gt;MonthName(review_date) as Review_MonthName&lt;/STRONG&gt;.... this would make your life easy... next... try this expression&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(

  RangeSum(Above(Sum(Agg(DISTINCT review_rating, review_id)), 0, RowNo()))
  /
  RangeSum(Above(Count(DISTINCT review_id), 0, RowNo()))

, product, (Review_MonthName, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 11:21:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605093#M44784</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-23T11:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605409#M44819</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Many thanks for your help. This works like charm. Although I'm not so sure why an additional aggregation is required for the chart. Is it because 2 dimensions are involved?&lt;/P&gt;&lt;P&gt;I have a follow-up question. With the cumulative average rating calculated, I would like to keep the value regardless of the review month selected by user. I tried to add set modifier in following way, but it didn't work out as I expected.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(

  RangeSum(Above(Sum({&amp;lt;review_month=&amp;gt;} Agg(DISTINCT review_rating, review_id)), 0, RowNo()))
  /
  RangeSum(Above(Count({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo()))

, product, (review_month, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;Any tips on how i can make it work?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 05:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605409#M44819</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2019-07-24T05:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605597#M44838</link>
      <description>&lt;P&gt;You will need to ignore the selection in review_month on the outer aggregation as well... try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Only({&amp;lt;review_month=&amp;gt;}
Aggr(

  RangeSum(Above(Sum({&amp;lt;review_month=&amp;gt;} Agg(DISTINCT review_rating, review_id)), 0, RowNo()))
  /
  RangeSum(Above(Count({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo()))

, product, (review_month, (NUMERIC)))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jul 2019 11:12:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605597#M44838</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-24T11:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605908#M44862</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Thanks for the tips. I tried it, but failed...&lt;/P&gt;&lt;P&gt;Please refer to the two screenshots below. I have first unfiltered for the review_month, then filtered for 2019 reviews.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table_all.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/16002i1070A70B70D15037/image-size/large?v=v2&amp;amp;px=999" role="button" title="table_all.JPG" alt="table_all.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table_2019.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/16003iD35481184EA77773/image-size/large?v=v2&amp;amp;px=999" role="button" title="table_2019.JPG" alt="table_2019.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can see that the cumulative count works, but the cumulative sum rating doesn't. It only adds up reviews from Jan 2019 to Jul 2019. As a result, the cumulative average rating is wrong too.&lt;/P&gt;&lt;P&gt;Here is my expression for cumulative count&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RangeSum(Above(Count({&amp;lt;review_month=&amp;gt;}DISTINCT review_id), 0, RowNo()))&lt;/LI-CODE&gt;&lt;P&gt;cumulative sum rating&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Only({&amp;lt;review_month=&amp;gt;} 
Aggr(
RangeSum(Above(SUM({&amp;lt;review_month=&amp;gt;} AGGR(DISTINCT review_rating,review_id)), 0, RowNo())),
product, (review_month, (NUMERIC))
)
)&lt;/LI-CODE&gt;&lt;P&gt;cumulative average rating&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Only({&amp;lt;review_month=&amp;gt;} 
Aggr(
RangeSum(Above(SUM({&amp;lt;review_month=&amp;gt;} AGGR(DISTINCT review_rating,review_id)), 0, RowNo()))
/
RangeSum(Above(COUNT({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo())),
product, (review_month, (NUMERIC))
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I see that the chart with "only" modifier does not change the x-axis range according to review_month selection. It's not critical, but it would be ideal if we can just visualize the selected review months.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 02:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1605908#M44862</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2019-07-25T02:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606058#M44869</link>
      <description>&lt;P&gt;One more change... adding another Only() within the Aggr() function....and removed DISTINCT&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Only({&amp;lt;review_month&amp;gt;} 
Aggr(
RangeSum(Above(Sum({&amp;lt;review_month&amp;gt;} Aggr(Only({&amp;lt;review_month&amp;gt;} review_rating), review_id)), 0, RowNo())),
product, (review_month, (NUMERIC))
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 11:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606058#M44869</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-25T11:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606311#M44903</link>
      <description>&lt;P&gt;Hi Sunny ,&lt;/P&gt;&lt;P&gt;The calculation works perfect. However, when I select the period in a chart, it doesn't make any difference visually...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chart2.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/16072i9C9BB441FCA7D75C/image-size/large?v=v2&amp;amp;px=999" role="button" title="chart2.JPG" alt="chart2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My average rating expression is now&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Only({&amp;lt;review_month&amp;gt;} 
Aggr(
RangeSum(Above(SUM({&amp;lt;review_month=&amp;gt;} AGGR(Only({&amp;lt;review_month&amp;gt;} review_rating),review_id)), 0, RowNo()))
/
RangeSum(Above(COUNT({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo())),
product, (review_month, (NUMERIC))
)
)&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 02:46:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606311#M44903</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2019-07-26T02:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606462#M44913</link>
      <description>&lt;P&gt;May be this if you intend to see only the review_month which are selected but still keep the accumulation...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr(
RangeSum(Above(SUM({&amp;lt;review_month=&amp;gt;} AGGR(Only({&amp;lt;review_month&amp;gt;} review_rating),review_id)), 0, RowNo()))
/
RangeSum(Above(COUNT({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo())),
product, (review_month, (NUMERIC))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 11:09:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606462#M44913</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-26T11:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606796#M44977</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help. However, this will just result in a single line in the chart. No product specific line is available.&lt;/P&gt;&lt;P&gt;I think I will just accept the fact that accumulation could not work for months invisible in the chart and apply the previous expression you suggested.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(

  RangeSum(Above(Sum({&amp;lt;review_month=&amp;gt;} Agg(DISTINCT review_rating, review_id)), 0, RowNo()))
  /
  RangeSum(Above(Count({&amp;lt;review_month=&amp;gt;} DISTINCT review_id), 0, RowNo()))

, product, (review_month, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 02:16:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606796#M44977</guid>
      <dc:creator>qliksensedlin</dc:creator>
      <dc:date>2019-07-29T02:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Average Rating over Distinct Reviews by RangeSum and Aggr</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606954#M44998</link>
      <description>&lt;P&gt;I think I am running into an issue where I am not 100% sure what you are after. May be if you can share a sample where we can see the issue, I might be able to help better.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Sunny&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 11:23:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Average-Rating-over-Distinct-Reviews-by-RangeSum-and/m-p/1606954#M44998</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-07-29T11:23:01Z</dc:date>
    </item>
  </channel>
</rss>

