<?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: Variable value for previous month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/1553767#M1168851</link>
    <description>&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Boa tarde amigo&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;tente a expressão&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;= MONTH (AddMonths (MAX (MonthName), - 1))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2019 16:25:29 GMT</pubDate>
    <dc:creator>jonnathanr</dc:creator>
    <dc:date>2019-03-07T16:25:29Z</dc:date>
    <item>
      <title>Variable value for previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381767#M1168847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to display numerical data for two months using text boxes. The value for the current month, and the value for the previous month as shown in the picture. I have a selection bar containing the various months as in attached picture. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a variable which shows the current month (August in this case) value, called Variable1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I want to get Variable1's values for the previous month (July in this case) . What code do i write?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;The previous month in code:&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #800000;"&gt;=Monthname(max(MonthName)-1&lt;/SPAN&gt;)&amp;nbsp; -&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;MonthName is the month variable from my table&lt;/SPAN&gt;] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;The code for the values i have shown under the current month in attached picture i.e August (95.4% &amp;amp; 93.5%) is: &lt;SPAN style="color: #800000;"&gt;=$(Variable1) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; [Summary: I want Variable1 value for =MonthName(max(MonthName)-1)]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a mill! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 06:44:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381767#M1168847</guid>
      <dc:creator />
      <dc:date>2012-08-29T06:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variable value for previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381768#M1168848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiii &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the below script to create the variable2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PERIOD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),-1)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Where PERIOD is the Fieldname which contains the date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Nilesh Gangurde&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 06:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381768#M1168848</guid>
      <dc:creator>nilesh_gangurde</dc:creator>
      <dc:date>2012-08-29T06:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variable value for previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381769#M1168849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;August:-vmonth=Month(now())&lt;/P&gt;&lt;P&gt;July:-vmonth-1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 06:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381769#M1168849</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2012-08-29T06:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Variable value for previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381770#M1168850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Nilesh and Sreenivas for your quick reply! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I would like to add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose I do not want to create a new variable and I just want use the old variable &lt;STRONG&gt;Variable1 (&lt;/STRONG&gt;it shows the calculated monthly score for current month aka August&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way where i can write an equation of the form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Equation:&amp;nbsp; call Variable 1 &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;for condition &lt;/EM&gt;&lt;/SPAN&gt;Monthname(max(MonthName)-1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Monthname(max(MonthName)-1) condition must be used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So July value field would be =__________(equation)_____________________&amp;nbsp; and it would display Variable1's particular value for July..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not too well versed in code so you guys are being really helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 08:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/381770#M1168850</guid>
      <dc:creator />
      <dc:date>2012-08-29T08:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Variable value for previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/1553767#M1168851</link>
      <description>&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Boa tarde amigo&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;tente a expressão&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;= MONTH (AddMonths (MAX (MonthName), - 1))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 16:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-value-for-previous-month/m-p/1553767#M1168851</guid>
      <dc:creator>jonnathanr</dc:creator>
      <dc:date>2019-03-07T16:25:29Z</dc:date>
    </item>
  </channel>
</rss>

