<?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: Previous Month Value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469339#M99539</link>
    <description>&lt;P&gt;Help me get the Open and Balance values.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TestV4.jpg" style="width: 608px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169136iD3905654032FF9FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="TestV4.jpg" alt="TestV4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 01:14:50 GMT</pubDate>
    <dc:creator>Phan_Anh_Son</dc:creator>
    <dc:date>2024-07-10T01:14:50Z</dc:date>
    <item>
      <title>Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/1765693#M59231</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create monthly balance from Jan 2020 to Aug. 2020:&lt;/P&gt;&lt;P&gt;but in some month there is no balance because no transactions has been done.&lt;/P&gt;&lt;P&gt;for the month without data I want to display the previous monthly balance&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="temppppp.png" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/45096iD2F876D3AC93F5CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="temppppp.png" alt="temppppp.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Find attached data and qvf.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 12:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/1765693#M59231</guid>
      <dc:creator>Riadh</dc:creator>
      <dc:date>2020-12-02T12:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/1765726#M59237</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/130790"&gt;@Riadh&lt;/a&gt;&amp;nbsp;!, please try this example :&lt;/P&gt;&lt;P&gt;//you can do this data of every period in multiples ways, for example, with a For Cycle, here is just one, with values direcly in inline&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Date&lt;BR /&gt;1-1-2020&lt;BR /&gt;1-2-2020&lt;BR /&gt;1-3-2020&lt;BR /&gt;1-4-2020&lt;BR /&gt;1-5-2020&lt;BR /&gt;1-6-2020&lt;BR /&gt;1-7-2020&lt;BR /&gt;1-8-2020&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;//then you need to make every data crossing, using this join with all Sccount and months&lt;/P&gt;&lt;P&gt;join&lt;BR /&gt;Load distinct Account FROM [lib://desktop (fabian_fabian)/temp previous Month.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;//then you add the existing data making null cells.&lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Account,&lt;BR /&gt;Date,&lt;BR /&gt;Balance&lt;BR /&gt;FROM [lib://desktop (fabian_fabian)/temp previous Month.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//finally you replace null with using peek() and previous()&lt;BR /&gt;Data2:&lt;BR /&gt;Load&lt;BR /&gt;if(isnull(Account), previous(Account), Account) as Account,&lt;BR /&gt;// Date,&lt;BR /&gt;monthname(Date) as Period,&lt;BR /&gt;Balance,&lt;BR /&gt;if(isnull(Balance) and Account = previous(Account), peek(Balance2), Balance) as Balance2&lt;BR /&gt;Resident Data&lt;BR /&gt;order By&lt;BR /&gt;Account, Date;&lt;BR /&gt;drop table Data;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 13:42:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/1765726#M59237</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2020-12-02T13:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469339#M99539</link>
      <description>&lt;P&gt;Help me get the Open and Balance values.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TestV4.jpg" style="width: 608px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169136iD3905654032FF9FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="TestV4.jpg" alt="TestV4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 01:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469339#M99539</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-07-10T01:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469343#M99540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/67056"&gt;@Phan_Anh_Son&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;TempData:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Date",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Account,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Buy,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Sales&lt;BR /&gt;FROM [lib://DataFiles/DATA_Test_V4.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;&lt;BR /&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Date",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Account,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Buy,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Sales,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If(Match(Account, Peek(Account)),Peek(Balance),0) AS Open,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If(Match(Account, Peek(Account)),Peek(Balance),0) + Buy - Sales AS Balance&lt;BR /&gt;RESIDENT&lt;BR /&gt;&lt;SPAN&gt; TempData&lt;/SPAN&gt;&lt;BR /&gt;ORDER BY&lt;BR /&gt;&lt;SPAN&gt; Account,&lt;/SPAN&gt;&lt;BR /&gt; Date&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE TempData;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 01:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469343#M99540</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-07-10T01:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469347#M99541</link>
      <description>&lt;P&gt;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Thank you for the solution! This worked exactly as per my requirement.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 03:05:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469347#M99541</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-07-10T03:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469362#M99542</link>
      <description>&lt;P&gt;Why do I have error when inserting more new data?&lt;/P&gt;
&lt;P&gt;huhu &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phan_Anh_Son_0-1720585404387.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169139i80DD40F924DEE9D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Phan_Anh_Son_0-1720585404387.png" alt="Phan_Anh_Son_0-1720585404387.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 04:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469362#M99542</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-07-10T04:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469593#M99552</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/67056"&gt;@Phan_Anh_Son&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;That is because you have more than one record for the same day and same Account.&lt;BR /&gt;This code should solve it:&lt;/P&gt;
&lt;PRE&gt;TempData:
LOAD
    "Date",
    Account,
    Sum(Buy) AS Buy,
    Sum(Sales) AS Sales
FROM
    [lib://DataFiles/DATA_Test_V4 (1).xlsx]
    (ooxml, embedded labels, table is Sheet1)
Group By
	Date,
    Account
;


Data:
LOAD
    "Date",
    Account,
    Buy,
    Sales,
    If(Match(Account, Peek(Account)),Peek(Balance),0) AS Open,
    If(Match(Account, Peek(Account)),Peek(Balance),0) + Buy - Sales AS Balance
RESIDENT
	TempData
ORDER BY
	Account,
    Date
;

DROP TABLE TempData;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2024 14:06:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469593#M99552</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-07-10T14:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469662#M99556</link>
      <description>&lt;P&gt;&lt;FONT face="arial black,avant garde" size="5" color="#FF0000"&gt;&lt;EM&gt;I am very thankful that you are considering my problem.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 15:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469662#M99556</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-07-10T15:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Value</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469668#M99557</link>
      <description>&lt;P&gt;You are very welcome&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/67056"&gt;@Phan_Anh_Son&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 15:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-Month-Value/m-p/2469668#M99557</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-07-10T15:50:14Z</dc:date>
    </item>
  </channel>
</rss>

