<?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: Current Month vs Prev Month script help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-Month-vs-Prev-Month-script-help/m-p/1792752#M1210845</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/57069"&gt;@qv11user&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like&lt;/P&gt;&lt;P&gt;Load *, Previous(Sales) as PrevSales from yoursource;&lt;/P&gt;&lt;P&gt;If you have multiple OPID, then try like below&lt;/P&gt;&lt;P&gt;Load *, If(OPID = Previous(OPID), Previous(Sales)) as PrevSales2 from yoursource;&lt;/P&gt;&lt;P&gt;Hope OPID ,Year &amp;amp; Month are in asc order.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 07:03:52 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2021-03-19T07:03:52Z</dc:date>
    <item>
      <title>Current Month vs Prev Month script help</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-vs-Prev-Month-script-help/m-p/1792749#M1210844</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;Hope everyone is safe and doing good&lt;/P&gt;&lt;P&gt;I have a requirement where i have data like below&lt;/P&gt;&lt;P&gt;OPID,Year,Month,Sales&lt;BR /&gt;OP1,2019,12,100&lt;BR /&gt;OP1,2020,1,110&lt;BR /&gt;OP1,2020,2,120&lt;BR /&gt;OP1,2020,3,130&lt;BR /&gt;OP1,2020,4,140&lt;BR /&gt;OP1,2020,5,150&lt;BR /&gt;OP1,2020,6,160&lt;BR /&gt;OP1,2020,7,170&lt;BR /&gt;OP1,2020,8,180&lt;BR /&gt;OP1,2020,9,190&lt;BR /&gt;OP1,2020,10,200&lt;BR /&gt;OP1,2020,11,210&lt;BR /&gt;OP1,2020,12,220&lt;BR /&gt;OP1,2021,1,230&lt;BR /&gt;OP1,2021,2,240&lt;/P&gt;&lt;P&gt;and i need to bring previous month sales for each month using script.&lt;BR /&gt;For ex for 2020/1 previous month is 2019/12&lt;/P&gt;&lt;P&gt;and expected output is:&lt;/P&gt;&lt;P&gt;OPID, Year, Month, Sales, PrevMonthSales&lt;BR /&gt;OP1, 2019, 12, 100, -&lt;BR /&gt;OP1, 2020, 1, 110, 100&lt;BR /&gt;OP1, 2020, 2, 120, 110&lt;BR /&gt;OP1, 2020, 3, 130, 120&lt;BR /&gt;OP1, 2020, 4, 140, 130&lt;BR /&gt;OP1, 2020, 5, 150, 140&lt;BR /&gt;OP1, 2020, 6, 160, 150&lt;BR /&gt;OP1, 2020, 7, 170, 160&lt;BR /&gt;OP1, 2020, 8, 180, 170&lt;BR /&gt;OP1, 2020, 9, 190, 180&lt;BR /&gt;OP1, 2020, 10, 200, 190&lt;BR /&gt;OP1, 2020, 11, 210, 200&lt;BR /&gt;OP1, 2020, 12, 220, 210&lt;BR /&gt;OP1, 2021, 1, 230, 220&lt;BR /&gt;OP1, 2021, 2, 240, 230&lt;/P&gt;&lt;P&gt;Could you please help me here?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 06:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-vs-Prev-Month-script-help/m-p/1792749#M1210844</guid>
      <dc:creator>qv11user</dc:creator>
      <dc:date>2021-03-19T06:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month vs Prev Month script help</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-vs-Prev-Month-script-help/m-p/1792752#M1210845</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/57069"&gt;@qv11user&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like&lt;/P&gt;&lt;P&gt;Load *, Previous(Sales) as PrevSales from yoursource;&lt;/P&gt;&lt;P&gt;If you have multiple OPID, then try like below&lt;/P&gt;&lt;P&gt;Load *, If(OPID = Previous(OPID), Previous(Sales)) as PrevSales2 from yoursource;&lt;/P&gt;&lt;P&gt;Hope OPID ,Year &amp;amp; Month are in asc order.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 07:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-vs-Prev-Month-script-help/m-p/1792752#M1210845</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-03-19T07:03:52Z</dc:date>
    </item>
  </channel>
</rss>

