<?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: Aggregation by previous year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976779#M80587</link>
    <description>&lt;P&gt;I found a solution (not totally statisfing as it has an "if" condition, but it works) :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if(Only({1}Year) = $(vYearN),

SUM(TOTAL&amp;lt;Product&amp;gt;  aggr (above(sum( {&amp;lt;Month={12}&amp;gt;}Sales),1,rowno()),Product,Year)),
Only(aggr (above(sum( {&amp;lt;Month={12}&amp;gt;}Sales),1,rowno()),Product,Year)))&lt;/LI-CODE&gt;
&lt;P&gt;Where vYearN is a variable defined as =Max({1}Year).&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2022 07:19:28 GMT</pubDate>
    <dc:creator>fabrice_lattern</dc:creator>
    <dc:date>2022-09-05T07:19:28Z</dc:date>
    <item>
      <title>Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976435#M80541</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;
&lt;P&gt;My data is composed of an amount of sales per year, month and product. I am trying to create a table where we could see, by year and product, the amount of sales in december of the previous year, like in the following example :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-02 16_51_36-Issue sales - Sample _ Feuille - Qlik Sense et 9 pages de plus - Travail – Micro.png" style="width: 761px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88189i6E435E2D85BCA5BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-02 16_51_36-Issue sales - Sample _ Feuille - Qlik Sense et 9 pages de plus - Travail – Micro.png" alt="2022-09-02 16_51_36-Issue sales - Sample _ Feuille - Qlik Sense et 9 pages de plus - Travail – Micro.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I used the following formula :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;only(aggr(above(sum( {&amp;lt;Month={12}&amp;gt;}Sales),1,rowno()),Product,Year))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which works well when we have december data for the year. The issue is that for 2022, I do not yet have december data, and the formula seems not to retrieve 2021 december data.&lt;/P&gt;
&lt;P&gt;Do you have any idea on the way to make it work for the ongoing year ?&lt;/P&gt;
&lt;P&gt;Thanks in advance for any idea !&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 14:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976435#M80541</guid>
      <dc:creator>fabrice_lattern</dc:creator>
      <dc:date>2022-09-02T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976490#M80554</link>
      <description>&lt;P&gt;Maybe this can work, if you just want to showcase the current year consolidated data, then create a variable having max(year) and put it in place of the month = 12,&amp;nbsp; then it could work. For month, create a month-year column in the master calendar in the datascript and then use it for the month calculation.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 17:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976490#M80554</guid>
      <dc:creator>deepanshuSh</dc:creator>
      <dc:date>2022-09-02T17:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976591#M80566</link>
      <description>&lt;P&gt;Hi, try next expression&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;Year, Year = {"&amp;lt;$(=Year(today()))"},&amp;nbsp; Month={12}&amp;gt;} Sales )&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2022 06:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976591#M80566</guid>
      <dc:creator>Timario</dc:creator>
      <dc:date>2022-09-03T06:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976592#M80567</link>
      <description>&lt;P&gt;if you need only&amp;nbsp;certain years you can use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;Year, Year = {'2019', '2021'}&lt;SPAN&gt;,&amp;nbsp; Month={12}&lt;/SPAN&gt; &amp;gt;} Sales )&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2022 06:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976592#M80567</guid>
      <dc:creator>Timario</dc:creator>
      <dc:date>2022-09-03T06:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976776#M80586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Thanks for the help, but this is not responding to the requirement, because you are not displaying the N-1 december result in front of year N (here you display december N in front of year N).&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 07:15:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976776#M80586</guid>
      <dc:creator>fabrice_lattern</dc:creator>
      <dc:date>2022-09-05T07:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation by previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976779#M80587</link>
      <description>&lt;P&gt;I found a solution (not totally statisfing as it has an "if" condition, but it works) :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if(Only({1}Year) = $(vYearN),

SUM(TOTAL&amp;lt;Product&amp;gt;  aggr (above(sum( {&amp;lt;Month={12}&amp;gt;}Sales),1,rowno()),Product,Year)),
Only(aggr (above(sum( {&amp;lt;Month={12}&amp;gt;}Sales),1,rowno()),Product,Year)))&lt;/LI-CODE&gt;
&lt;P&gt;Where vYearN is a variable defined as =Max({1}Year).&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 07:19:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-by-previous-year/m-p/1976779#M80587</guid>
      <dc:creator>fabrice_lattern</dc:creator>
      <dc:date>2022-09-05T07:19:28Z</dc:date>
    </item>
  </channel>
</rss>

