<?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 Month over Month Calculation within Scripts in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Month-over-Month-Calculation-within-Scripts/m-p/1869229#M71771</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;Hope you all are doing well and are getting ready for the holiday's!&amp;nbsp; I've come across an issue that I have been trying to program for the past day or two, and just cannot wrap my head around it.&amp;nbsp; Basically, I am trying to create a month-over-month and year-over-year pivot table, but do not want to use my existing (Below) function due to this not being 100% accurate.&lt;/P&gt;
&lt;P&gt;I've tried using Lookup and conditional Sums - hopefully it is just a syntax error.&amp;nbsp; My table looks like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Month&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Previous Month&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;Quantity (=sum(DailyQuantity)&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;MoM&amp;nbsp;(WANT TO ADD IN TABLE)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Dec 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Nov 2021&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;55&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;189%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Nov 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Oct 2021&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;29&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;64%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Oct 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Sep 2921&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;45&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;To calculate Month-over-Month, I want to use the Quantity of Dec 2021 and divide by the Quantity of Nov 2021 (55/29=189%)&lt;/P&gt;
&lt;P&gt;I have tried a few set expressions:&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;=sum({&amp;lt;'Month'={'=addmonths([Month],-1)'}&amp;gt;}[Quantity])
&lt;OL&gt;
&lt;LI&gt;Results the same quantity as original month&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;=Sum({$&amp;lt;[Month]={"$(=[Previous Month]"},[Previous Month]=&amp;gt;}[Quantity])
&lt;OL&gt;
&lt;LI&gt;Returns null&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Not sure where to go next.&amp;nbsp; Unfortunately using the "Above" and "Below" functions just won't work in our use case.&amp;nbsp; Do y'all have any other ideas that I can try looking at?&lt;/P&gt;
&lt;P&gt;Thanks and have a great day!&lt;/P&gt;
&lt;P&gt;-Cannon&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:25:38 GMT</pubDate>
    <dc:creator>CyberCannon</dc:creator>
    <dc:date>2024-11-15T23:25:38Z</dc:date>
    <item>
      <title>Month over Month Calculation within Scripts</title>
      <link>https://community.qlik.com/t5/App-Development/Month-over-Month-Calculation-within-Scripts/m-p/1869229#M71771</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;Hope you all are doing well and are getting ready for the holiday's!&amp;nbsp; I've come across an issue that I have been trying to program for the past day or two, and just cannot wrap my head around it.&amp;nbsp; Basically, I am trying to create a month-over-month and year-over-year pivot table, but do not want to use my existing (Below) function due to this not being 100% accurate.&lt;/P&gt;
&lt;P&gt;I've tried using Lookup and conditional Sums - hopefully it is just a syntax error.&amp;nbsp; My table looks like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Month&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Previous Month&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;Quantity (=sum(DailyQuantity)&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;MoM&amp;nbsp;(WANT TO ADD IN TABLE)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Dec 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Nov 2021&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;55&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;189%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Nov 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Oct 2021&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;29&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;64%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Oct 2021&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Sep 2921&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;45&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;To calculate Month-over-Month, I want to use the Quantity of Dec 2021 and divide by the Quantity of Nov 2021 (55/29=189%)&lt;/P&gt;
&lt;P&gt;I have tried a few set expressions:&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;=sum({&amp;lt;'Month'={'=addmonths([Month],-1)'}&amp;gt;}[Quantity])
&lt;OL&gt;
&lt;LI&gt;Results the same quantity as original month&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;=Sum({$&amp;lt;[Month]={"$(=[Previous Month]"},[Previous Month]=&amp;gt;}[Quantity])
&lt;OL&gt;
&lt;LI&gt;Returns null&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Not sure where to go next.&amp;nbsp; Unfortunately using the "Above" and "Below" functions just won't work in our use case.&amp;nbsp; Do y'all have any other ideas that I can try looking at?&lt;/P&gt;
&lt;P&gt;Thanks and have a great day!&lt;/P&gt;
&lt;P&gt;-Cannon&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:25:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-over-Month-Calculation-within-Scripts/m-p/1869229#M71771</guid>
      <dc:creator>CyberCannon</dc:creator>
      <dc:date>2024-11-15T23:25:38Z</dc:date>
    </item>
  </channel>
</rss>

