<?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: Define variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817870#M288355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please explain how formula works. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Mar 2015 22:30:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-02T22:30:38Z</dc:date>
    <item>
      <title>Define variables</title>
      <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817868#M288353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I need to define dynamic variable based on today's date. need assistance when it comes to year &amp;amp; month logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gives me current day.&lt;/P&gt;&lt;P&gt;Let vCurrentDay = Day(today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gives me current month in words &amp;amp; in numbers.&lt;/P&gt;&lt;TABLE style="font-size: 13.3333330154419px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LET vCurrentMonth&lt;/TD&gt;&lt;TD&gt;= Month(Today());&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Gives me current year:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Let vCurrentYear = Year(Today());&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I need help defining following.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Give me Month start variable that will be 3 months prior to current month regardless of what date we fall into current month.&lt;/LI&gt;&lt;/OL&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So if we are in Mar it should return Jan. Basically it is going back entire 3 months not 3 months from today. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Give me Year&amp;nbsp; variable that will fall into whatever MonthStart (point#1) falls into. &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 22:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817868#M288353</guid>
      <dc:creator />
      <dc:date>2015-03-02T22:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Define variables</title>
      <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817869#M288354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AddMonths(MonthStart(Today()),-2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;AddMonths(MonthStart(Today()),-2)&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 22:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817869#M288354</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-02T22:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Define variables</title>
      <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817870#M288355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please explain how formula works. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 22:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817870#M288355</guid>
      <dc:creator />
      <dc:date>2015-03-02T22:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Define variables</title>
      <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817871#M288356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;monthstart(Today()) is the start month of today&amp;nbsp; &lt;/P&gt;&lt;P&gt;addmonths(........, -2) is &lt;SPAN style="font-size: 13.3333330154419px;"&gt;the start month of today minus 2 months&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my date is in DD/MM/YYYY format&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/79691_1.jpg" style="font-size: 13.3333330154419px; height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 22:41:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817871#M288356</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-02T22:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Define variables</title>
      <link>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817872#M288357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MonthStart ()&lt;/P&gt;&lt;P&gt;Returns a value corresponding to a timestamp with the first millisecond of the first date of the month containing &lt;SPAN class="Italic"&gt;date&lt;/SPAN&gt;. The default output format will be the DateFormat set in the script. &lt;SPAN class="Italic"&gt;Shift&lt;/SPAN&gt; is an integer, where the value 0 indicates the month which contains &lt;SPAN class="Italic"&gt;date&lt;/SPAN&gt;. Negative values in &lt;SPAN class="Italic"&gt;shift&lt;/SPAN&gt; indicate preceding months and positive values indicate succeeding months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;monthstart ( '2001-10-19' )&lt;/SPAN&gt; returns '2001-10-01' with an underlying numeric value corresponding to '2001-10-01 00:00:00.000'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;monthstart ( '2001-10-19', -1 )&lt;/SPAN&gt; returns '2001-09-01' with an underlying numeric value corresponding to '2001-09-01 00:00:00.000'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor481"&gt;&lt;/A&gt;&lt;A name="AddMonths"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;AddMonths(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;startdate&lt;/SPAN&gt;, &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; , &lt;SPAN class="Italic"&gt;[ , mode] &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Returns the date occurring &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; months after &lt;SPAN class="Italic"&gt;startdate&lt;/SPAN&gt; or, if &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; is negative, the date occurring &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; months before &lt;SPAN class="Italic"&gt;startdate&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;By specifying a &lt;SPAN class="Italic"&gt;mode&lt;/SPAN&gt; (0 if omitted) the date is set to either the unmodified day of the specified month (&lt;SPAN class="Italic"&gt;mode&lt;/SPAN&gt;=0) or the calculated day as derived from the end of the month (&lt;SPAN class="Italic"&gt;mode&lt;/SPAN&gt;=1). &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',3)&lt;/SPAN&gt; returns '2003-04-29'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',3,0)&lt;/SPAN&gt; returns '2003-04-29'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',3,1)&lt;/SPAN&gt; returns '2003-04-28'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',1,0)&lt;/SPAN&gt; returns '2003-02-28'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',1,1)&lt;/SPAN&gt; returns '2003-02-26'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-02-28',1,0)&lt;/SPAN&gt; returns '2003-03-28'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-02-28',1,1)&lt;/SPAN&gt; returns '2003-03-31'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 01:00:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Define-variables/m-p/817872#M288357</guid>
      <dc:creator>manojkulkarni</dc:creator>
      <dc:date>2015-03-03T01:00:14Z</dc:date>
    </item>
  </channel>
</rss>

