<?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: problem with  end date using a LET variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345262#M704511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using Date() function with a value that is not a date (the variable). According to your LET script above, the following works here, note the Date#() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Date(MonthStart(AddMonths(Date#($(vPeriod), 'YYYYMM'), 12)), 'YYYYMM')&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 09:42:30 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-04-11T09:42:30Z</dc:date>
    <item>
      <title>problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345256#M704505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following variable: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vPeriod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(Makedate(YEAR,Month,1),'YYYYMM');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use one of these expression in my field date(Makedate(YEAR,Month,1),'YYYYMM') as Period, it works &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Now I want to create the end period using the Let statement 'vPeriod'&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;year,&lt;/P&gt;&lt;P&gt;month,&lt;/P&gt;&lt;P&gt;Date(monthstart(addmonths('$(vPeriod)',12)),'YYYYMM') as EndPeriode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Database......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get any error when reloading. However no data can be found in the EndPeriode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iSam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 15:28:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345256#M704505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-10T15:28:13Z</dc:date>
    </item>
    <item>
      <title>problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345257#M704506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Did you checked without $()?like this&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;year,&lt;/P&gt;&lt;P&gt;month,&lt;/P&gt;&lt;P&gt;Date(monthstart(addmonths(vPeriod,12)),'YYYYMM') as EndPeriode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Database......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 15:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345257#M704506</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-04-10T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345258#M704507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi iSam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just do not warp the expansion using single quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Date(monthstart(addmonths(&lt;EM&gt;&lt;STRONG&gt;$(vPeriod)&lt;/STRONG&gt;&lt;/EM&gt;,12)),'YYYYMM') as EndPeriode&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 15:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345258#M704507</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-04-10T15:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345259#M704508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i do that, I get the following error: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error in expression:&lt;/P&gt;&lt;P&gt;')' expected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression seems to be oke right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(monthstart(addmonths($(vPeriod),12)),'YYYYMM') as EndPeriod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 17:20:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345259#M704508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-10T17:20:37Z</dc:date>
    </item>
    <item>
      <title>problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345260#M704509</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;If I remove the $ sign I get the error that the field cannot be found. Which makes sense &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;Thanks for your help so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Isam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 17:22:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345260#M704509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-10T17:22:47Z</dc:date>
    </item>
    <item>
      <title>problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345261#M704510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aboumejjane,&lt;/P&gt;&lt;P&gt;Maybe this solution is not so smart, but I think it works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vEndPeriod = Date(monthstart(addmonths(vPeriod,12)),'YYYYMM');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD data, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (1=1,$(vEndPeriod)) as EndPeriode&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Giampiero&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 09:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345261#M704510</guid>
      <dc:creator />
      <dc:date>2012-04-11T09:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345262#M704511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using Date() function with a value that is not a date (the variable). According to your LET script above, the following works here, note the Date#() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Date(MonthStart(AddMonths(Date#($(vPeriod), 'YYYYMM'), 12)), 'YYYYMM')&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 09:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345262#M704511</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-04-11T09:42:30Z</dc:date>
    </item>
    <item>
      <title>problem with  end date using a LET variable</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345263#M704512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help and sorry for my very late response!&lt;/P&gt;&lt;P&gt;I found the problem. I was using the date function twice, once in the in the variable and once in my expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should have been&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vPeriod =&amp;nbsp; Makedate(Year,Month,1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Date(monthstart(addmonths('$(vPeriod)',12)),'YYYYMM') as EndPeriod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tried your solution yet, But I assume that that will work also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iSam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 13:55:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-end-date-using-a-LET-variable/m-p/345263#M704512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-19T13:55:02Z</dc:date>
    </item>
  </channel>
</rss>

