<?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: Set analysis to last month value. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1526105#M747228</link>
    <description>Hi,&lt;BR /&gt;like I said, maybe you need to add a new column:&lt;BR /&gt;monthname(DocDate) as Doc_Monthname&lt;BR /&gt;then use below expression:&lt;BR /&gt;sum({&amp;lt;Doc_Monthname={"$(=monthname(max(Doc_Monthname),-1))"}&amp;gt;} [LY in Rs])&lt;BR /&gt;Please try, it worked in my desktop.&lt;BR /&gt;Aiolos Zhao</description>
    <pubDate>Fri, 04 Jan 2019 02:01:18 GMT</pubDate>
    <dc:creator>uacg0009</dc:creator>
    <dc:date>2019-01-04T02:01:18Z</dc:date>
    <item>
      <title>Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525690#M747221</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am facing the the issue in calculating the last month value.&lt;/P&gt;&lt;P&gt;I am using the fiscal calendar starting from April to March.&lt;/P&gt;&lt;P&gt;Below is my master calendar code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;temp_date:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;min(DocDate) as start_date,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Max(DocDate) as end_date&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Resident Revenue;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Let vstart_date=peek('start_date',0,temp_date);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Let vEnd_date=peek('end_date',0,temp_date);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;drop Table temp_date;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;TempCalendar:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;date($(vstart_date) + rowno() - 1) As DocDate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Autogenerate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;$(vEnd_date) - $(vstart_date) + 1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;MasterCalendar:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DocDate,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;num(Month(DocDate)) as DocMonth,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;Month(DocDate) AS Doc_Month,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;If(Month(DocDate) &amp;gt; 0 and Month(DocDate) &amp;lt; 4, 'FY-'&amp;amp;(Year(DocDate)-1)&amp;amp;'-'&amp;amp;Right(Year(DocDate),2),'FY-'&amp;amp;Year(DocDate)&amp;amp;'-'&amp;amp;Right((Year(DocDate)+1),2)) as DocYear_Filter,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;If(Month(DocDate) &amp;gt; 0 and Month(DocDate) &amp;lt; 4, Year(DocDate)) as DocYear&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;resident TempCalendar;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;DROP Table TempCalendar;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the last month value.&lt;/P&gt;&lt;P&gt;I have used the following expression.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;sum({&amp;lt;DocMonth={"$(=max({&amp;lt;DocYear={'$(=max(DocYear))'}&amp;gt;}DocMonth)-1)"}&amp;gt;}&amp;nbsp; &amp;nbsp; &amp;nbsp;[LY in Rs])&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It should calculate the value for December 2018 as the current month is January 2019.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But its giving me the value as 0.&lt;/P&gt;&lt;P&gt;Please Help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priyal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525690#M747221</guid>
      <dc:creator>priyalvp24</dc:creator>
      <dc:date>2024-11-16T04:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525697#M747223</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Try to replace single quotes from&amp;nbsp;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;$(=max(DocYear))&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;}&lt;/SPAN&gt; to brackets [...]:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;sum({&amp;lt;DocMonth={"$(=max({&amp;lt;DocYear={&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/FONT&gt;$(=max(DocYear))&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;}&amp;gt;}DocMonth)-1)"}&amp;gt;}&amp;nbsp; &amp;nbsp; &amp;nbsp;[LY in Rs])&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 08:29:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525697#M747223</guid>
      <dc:creator>Zhandos_Shotan</dc:creator>
      <dc:date>2019-01-03T08:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525701#M747224</link>
      <description>Hi,&lt;BR /&gt;Its Not Working</description>
      <pubDate>Thu, 03 Jan 2019 08:42:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525701#M747224</guid>
      <dc:creator>priyalvp24</dc:creator>
      <dc:date>2019-01-03T08:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525706#M747225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think the problem is :&lt;/P&gt;&lt;P&gt;max(Docyear) is 2019&lt;/P&gt;&lt;P&gt;in 2019 max(month) = 1&lt;/P&gt;&lt;P&gt;and in 2019 max(month)&amp;nbsp; - 1 = 0&lt;/P&gt;&lt;P&gt;so I get the zero value&lt;/P&gt;&lt;P&gt;I think it's better to create another field, like monthname or something else including year and month&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;P&gt;Aiolos Zhao&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 08:56:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525706#M747225</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-01-03T08:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525758#M747227</link>
      <description>&lt;P&gt;Hi Aiolos Zhao,&lt;BR /&gt;It will be a great help if you sent the expression.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 11:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1525758#M747227</guid>
      <dc:creator>priyalvp24</dc:creator>
      <dc:date>2019-01-03T11:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1526105#M747228</link>
      <description>Hi,&lt;BR /&gt;like I said, maybe you need to add a new column:&lt;BR /&gt;monthname(DocDate) as Doc_Monthname&lt;BR /&gt;then use below expression:&lt;BR /&gt;sum({&amp;lt;Doc_Monthname={"$(=monthname(max(Doc_Monthname),-1))"}&amp;gt;} [LY in Rs])&lt;BR /&gt;Please try, it worked in my desktop.&lt;BR /&gt;Aiolos Zhao</description>
      <pubDate>Fri, 04 Jan 2019 02:01:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1526105#M747228</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-01-04T02:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to last month value.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1527423#M747229</link>
      <description>thanks,its working</description>
      <pubDate>Tue, 08 Jan 2019 05:23:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-last-month-value/m-p/1527423#M747229</guid>
      <dc:creator>priyalvp24</dc:creator>
      <dc:date>2019-01-08T05:23:34Z</dc:date>
    </item>
  </channel>
</rss>

