<?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: Result of previous year in a aggr(only()) function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068787#M87659</link>
    <description>&lt;P&gt;Dear Chanty4u&lt;/P&gt;
&lt;P&gt;Thank you for the formula.&lt;/P&gt;
&lt;P&gt;This is working, but only if you also select the previous year. (2023 + 2022)&lt;/P&gt;
&lt;P&gt;If you only select 1 year and 1 or more months, you get no result (0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bianca&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2023 15:35:32 GMT</pubDate>
    <dc:creator>BiancaWou</dc:creator>
    <dc:date>2023-05-08T15:35:32Z</dc:date>
    <item>
      <title>Result of previous year in a aggr(only()) function</title>
      <link>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068680#M87651</link>
      <description>&lt;P&gt;I have this function including aggr and only&lt;/P&gt;
&lt;P&gt;sum(aggr(only({&amp;lt;InstalledBaseFlag={1}, InstalledBaseType -={DeinstallNew}&amp;gt;}_InstalledBaseCumul), MonthYear, InstalledBaseType, ProdHier1, SoldTo, Region, Product))&lt;/P&gt;
&lt;P&gt;This formula gives me the result of the selected Month and Year, example April 2023&lt;/P&gt;
&lt;P&gt;Now, I would like to compare this with the result of the previous year (selection will still be April 2023, but I would like to see the numbers of April 2022 with the function AddMonths -12&lt;/P&gt;
&lt;P&gt;If I use this formula&lt;/P&gt;
&lt;P&gt;sum(aggr(only({&amp;lt;&amp;lt;MonthYearNum=&lt;BR /&gt;"$(=Num(Max(AddMonths(MonthYearNum,-12))))"},Year=,Month=,MonthYear=,Day=,YTD,InstalledBaseFlag={1}, InstalledBaseType -={DeinstallNew}&amp;gt;}_InstalledBaseCumul), &lt;BR /&gt;MonthYear, InstalledBaseType, ProdHier1, SoldTo, Region, Product))&lt;/P&gt;
&lt;P&gt;I get no result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This formula without the aggr() is working(but incorrect), but when I add the aggr and only, it is not working&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;MonthYearNum={"$(=Num(Max(AddMonths(MonthYearNum,-12))))"},Year=,Month=,MonthYear=,Day=,YTD,InstalledBaseFlag={1}, InstalledBaseType -={DeinstallNew}&amp;gt;}_InstalledBaseCumul)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I get from this formula&lt;/P&gt;
&lt;P&gt;sum(aggr(only({&amp;lt;InstalledBaseFlag={1}, InstalledBaseType -={DeinstallNew}&amp;gt;}_InstalledBaseCumul), MonthYear, InstalledBaseType, ProdHier1, SoldTo, Region, Product))&lt;/P&gt;
&lt;P&gt;to the result of the previous year (when selected a year and a month)&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Bianca&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 12:42:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068680#M87651</guid>
      <dc:creator>BiancaWou</dc:creator>
      <dc:date>2023-05-08T12:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Result of previous year in a aggr(only()) function</title>
      <link>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068735#M87655</link>
      <description>&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum(aggr(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; only({&amp;lt;InstalledBaseFlag={1}, InstalledBaseType-={DeinstallNew}, MonthYearNum = {"$(=Num(Max(AddMonths(MonthYearNum, -12))))"}&amp;gt;}_InstalledBaseCumul),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; InstalledBaseType, ProdHier1, SoldTo, Region, Product&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;))&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 14:20:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068735#M87655</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-05-08T14:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Result of previous year in a aggr(only()) function</title>
      <link>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068787#M87659</link>
      <description>&lt;P&gt;Dear Chanty4u&lt;/P&gt;
&lt;P&gt;Thank you for the formula.&lt;/P&gt;
&lt;P&gt;This is working, but only if you also select the previous year. (2023 + 2022)&lt;/P&gt;
&lt;P&gt;If you only select 1 year and 1 or more months, you get no result (0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bianca&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 15:35:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Result-of-previous-year-in-a-aggr-only-function/m-p/2068787#M87659</guid>
      <dc:creator>BiancaWou</dc:creator>
      <dc:date>2023-05-08T15:35:32Z</dc:date>
    </item>
  </channel>
</rss>

