<?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: Interesting aggregate challenge in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774663#M60012</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;You understood it well. Mistake was on my end. I started developing loops so once i saw this i was felt i started overengineering the solution. What's the purpose of the Offset column? Incorporates years that need to be included in the aggregation&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 08:10:49 GMT</pubDate>
    <dc:creator>markobanjanin</dc:creator>
    <dc:date>2021-01-15T08:10:49Z</dc:date>
    <item>
      <title>Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774466#M59992</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I am faced with an interesting challenge - I need to perform an aggregations against my data set across multiple years and show counts that include/exclude specific records.&lt;/P&gt;&lt;P&gt;Let us assume I am working at an ice cream shop and on yearly basis i am capturing the following data for ice cream production:&lt;/P&gt;&lt;P&gt;Type:&amp;nbsp; Actual/Forecast - denotes what I am either planning to use as my ingredients vs what I actually used&lt;/P&gt;&lt;P&gt;Ingredient: ice cream ingredient&lt;/P&gt;&lt;P&gt;I am reporting on yearly forecasts and actuals twice in a calendar year.&lt;/P&gt;&lt;P&gt;Example data set:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Ingredient&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Sugar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Food color&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Sugar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Food color&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Egg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Sugar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Food color&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Milk&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Egg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Milk&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Almod milk&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Food color&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;Forecast&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Ice cream&lt;/TD&gt;&lt;TD&gt;Flour&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Expected outcome:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;year&lt;/TD&gt;&lt;TD&gt;actual ingredient count&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;need to show&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Logic for &lt;STRONG&gt;Need to show&lt;/STRONG&gt; calculation:&lt;/P&gt;&lt;P&gt;For year 2020 I want to include all Actual and Forecast ingredients and on top of that add Actual ingredients from 2019 and 2018. Year 2020 Actuals are my basis (there are 3 ingredients) . Forecast 2020 includes 1 new&amp;nbsp;ingredient (Eggs), Actuals 2019 and 2018 include 2 more&amp;nbsp;ingredients (Milk + Almond milk). Same&amp;nbsp;ingredients should not be double counted, only different one.&lt;/P&gt;&lt;P&gt;The same logic applies when I switch to year 2019; I would use 2019 Actuals as the basis and compare the list to Forecast 2019 and Actuals 2018 and 2017.&lt;/P&gt;&lt;P&gt;What would be the best way to tackle this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774466#M59992</guid>
      <dc:creator>markobanjanin</dc:creator>
      <dc:date>2021-01-14T16:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774474#M59994</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18624"&gt;@Gysbert_Wassenaar&lt;/a&gt;&amp;nbsp;maybe I can pick your brain here? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:31:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774474#M59994</guid>
      <dc:creator>markobanjanin</dc:creator>
      <dc:date>2021-01-14T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774657#M60009</link>
      <description>&lt;P&gt;I think I must be missing part of the logic. For 2019 I get 4 Actual ingredients and 7 need-to-show:&lt;/P&gt;&lt;P&gt;Actual 2019: Water, Sugar,Food color, Milk: 4&lt;/P&gt;&lt;P&gt;Forecast 2019: Food color, Water: 0 because they're also in the Actual 2019&lt;/P&gt;&lt;P&gt;Actual 2018: Egg, Almond milk: 2&lt;/P&gt;&lt;P&gt;Actual 2017: Flour: 1&lt;/P&gt;&lt;P&gt;Total 7&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 07:56:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774657#M60009</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2021-01-15T07:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774663#M60012</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;You understood it well. Mistake was on my end. I started developing loops so once i saw this i was felt i started overengineering the solution. What's the purpose of the Offset column? Incorporates years that need to be included in the aggregation&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 08:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774663#M60012</guid>
      <dc:creator>markobanjanin</dc:creator>
      <dc:date>2021-01-15T08:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774669#M60014</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/11183"&gt;@markobanjanin&lt;/a&gt;&amp;nbsp;&amp;nbsp;can you please share the expression used for this solution.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 08:27:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774669#M60014</guid>
      <dc:creator>Qlik1_User1</dc:creator>
      <dc:date>2021-01-15T08:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774732#M60024</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18624"&gt;@Gysbert_Wassenaar&lt;/a&gt;,&amp;nbsp;i added a few more data points to the table and noticed Offset 0 included both Actuals and Forecast for each AsofYear. I added a more detailed grain to the&amp;nbsp;AsOfYear2 table and joined the two with a new key.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 10:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774732#M60024</guid>
      <dc:creator>markobanjanin</dc:creator>
      <dc:date>2021-01-15T10:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774733#M60025</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/91927"&gt;@Qlik1_User1&lt;/a&gt;&amp;nbsp;you can see used approach in attached qvf (1) file. Initially I was building this in the script but seems it was overengineering it. Now i just need to automate mapping creation&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 10:38:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1774733#M60025</guid>
      <dc:creator>markobanjanin</dc:creator>
      <dc:date>2021-01-15T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting aggregate challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1775117#M60071</link>
      <description>&lt;P&gt;Hi Marko,&lt;/P&gt;&lt;P&gt;Yes, the Offset is to make sure that only the forecast of the Year with the same value as AsOfYear is included, ie the Year that has Offset value 0. The Actuals are aggregated for all three Years per AsOfYear.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 06:32:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interesting-aggregate-challenge/m-p/1775117#M60071</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2021-01-18T06:32:25Z</dc:date>
    </item>
  </channel>
</rss>

