<?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: Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables/m-p/495933#M1129217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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;vCurrentMonth=MonthName(today())&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonthLess1=&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),-1) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonthLess2=&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),-2) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Dec 2013 18:12:48 GMT</pubDate>
    <dc:creator>marthacano01</dc:creator>
    <dc:date>2013-12-17T18:12:48Z</dc:date>
    <item>
      <title>Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Variables/m-p/495931#M1129215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking to use variables to restrict data shown in straight tables, pivot tables and bar graphs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I set the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth=MonthName(today())&lt;/P&gt;&lt;P&gt;vCurrentMonthLess1=vCurrentMonth-1&lt;/P&gt;&lt;P&gt;vCurrentMonthLess2=vCurrentMonth-2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then set the document properties number format to Date MMM YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This produces the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth = Dec 2013&lt;/P&gt;&lt;P&gt;vCurrentMonthLess1 = Nov 2013&lt;/P&gt;&lt;P&gt;vCurrentMonthLess2 = Nov 2013 (Not sure why this doesn't return Oct 2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when I try to use the vCurrentMonthLess1 as a variable in the straight table it returns a number 41608 rather than Nov 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 17:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables/m-p/495931#M1129215</guid>
      <dc:creator>danielnevitt</dc:creator>
      <dc:date>2013-12-17T17:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Variables/m-p/495932#M1129216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look up the Monthname function in the help file you will see that it returns a date as underlying value. The month name is merely the display format. Monthname(today()) returns the date december 1st. If you subtract 1 from that you get november 30. If you subtract another day from that you get november 29. What you can do instead is use &lt;EM&gt;addmonths(vCurrentMonth, -1&lt;/EM&gt;) and &lt;EM&gt;addmonths(vCurrentMonth, -2)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 18:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables/m-p/495932#M1129216</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-17T18:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Variables/m-p/495933#M1129217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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;vCurrentMonth=MonthName(today())&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonthLess1=&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),-1) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonthLess2=&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),-2) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 18:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables/m-p/495933#M1129217</guid>
      <dc:creator>marthacano01</dc:creator>
      <dc:date>2013-12-17T18:12:48Z</dc:date>
    </item>
  </channel>
</rss>

