<?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 Calendar Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549897#M686492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is with the let statement.&amp;nbsp; What date are you trying to set it to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jan 2014 14:36:27 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2014-01-03T14:36:27Z</dc:date>
    <item>
      <title>Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549896#M686491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I keep getting the following error message in my calendar script:don't see where there is a problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error in expression: ')' expected&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have narrowed it down to this part of the script that is causing the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LET &lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;vYTD&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;= &lt;SPAN style="color: #0000ff;"&gt;Floor&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;MakeDate&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Year&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;()), (&lt;SPAN style="color: #0000ff;"&gt;Month&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;())-1), &lt;SPAN style="color: #0000ff;"&gt;Day&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;MonthEnd&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;()))-1)); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(InYearToDate(Date, $(vYTD), 0) &lt;BR /&gt;or InYearToDate(Date, '12/31/2013', -1)&lt;BR /&gt;or InYearToDate(Date, '12/31/2013', -2)&lt;BR /&gt;or InYearToDate(Date, '12/31/2013', -3)&lt;BR /&gt;or InYearToDate(Date, '12/31/2013', -4)&lt;BR /&gt;, 1, 0) as _YTD,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;SPAN&gt;If(InYearToDate(Date, $(vYTD), 0) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or InYearToDate(Date, $(vYTD), -1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or InYearToDate(Date, $(vYTD), -2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or InYearToDate(Date, $(vYTD), -3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or InYearToDate(Date, $(vYTD), -4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;, 'YTD') as YTD, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549896#M686491</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-01-03T14:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549897#M686492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is with the let statement.&amp;nbsp; What date are you trying to set it to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549897#M686492</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-03T14:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549898#M686493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try changing the LET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYTD = FLOOR(MAKEDATE(2014))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MakeDate function will always default to the start of the year, so when you say 2014 it will give you back 1/1/2014 regardless&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:39:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549898#M686493</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2014-01-03T14:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549899#M686494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could also do what you were doing above but just change it to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYTD = Floor(MakeDate(Year(Today())));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549899#M686494</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2014-01-03T14:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549900#M686495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am picking up someone else's code so just wondering -&amp;nbsp; wouldn't changing this current variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LET &lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;vYTD&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;= &lt;SPAN style="color: #0000ff;"&gt;Floor&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;MakeDate&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Year&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;()), (&lt;SPAN style="color: #0000ff;"&gt;Month&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;())-1), &lt;SPAN style="color: #0000ff;"&gt;Day&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;MonthEnd&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;()))-1)); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;to your suggestion:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LET vYTD = Floor(MakeDate(Year(Today())));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ultimately change what the variable is returning (a different result). Sorry kind of new to the calendar.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:55:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549900#M686495</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-01-03T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549901#M686496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What date is it supposed to be returning?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:57:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549901#M686496</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-03T14:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549902#M686497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to check if the variable works when you add it to a Text Object in the front end&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:03:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549902#M686497</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2014-01-03T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549903#M686498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Sorry Nicole - kind of still figuring that out. I am picking up where someone left off,&amp;nbsp; At least I know it is the LET statement causing the problem. Now I just have to see what was intended with it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:04:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549903#M686498</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-01-03T15:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549904#M686499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYTD = MAX(Year);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549904#M686499</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2014-01-03T15:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549905#M686500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Wouldnt&amp;nbsp; that give you 2014? January 2014 data isn't loaded as of today so Dec 2013 is still the latest data (YTD) data. Somehow I need to account for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549905#M686500</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-01-03T15:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549906#M686501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following will give you the end date of last month:&lt;/P&gt;&lt;P&gt;LET vYTD = Monthend(Addmonths(today(),-1));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549906#M686501</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-03T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549907#M686503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The makedate() in this expression is:&lt;/P&gt;&lt;P&gt;makedate(2014,&lt;STRONG&gt;0&lt;/STRONG&gt;,30) - that is month is 0 (January minus 1), hence the error.&lt;/P&gt;&lt;P&gt;If you want it to be the end of the previous month, use&lt;/P&gt;&lt;P&gt;=monthend(today(),-1)&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:45:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549907#M686503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-03T15:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549908#M686504</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;You add expression in&amp;nbsp; text box and check it out..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:52:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549908#M686504</guid>
      <dc:creator />
      <dc:date>2014-01-03T15:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549909#M686505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My YTD field doesn't populate with this variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYTD =monthend(today(),-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;If(InYearToDate(Date, $(vYTD), 0) &lt;BR /&gt;or InYearToDate(Date, $(vYTD), -1)&lt;BR /&gt;or InYearToDate(Date, $(vYTD), -2)&lt;BR /&gt;or InYearToDate(Date, $(vYTD), -3)&lt;BR /&gt;or InYearToDate(Date, $(vYTD), -4)&lt;BR /&gt;, 'YTD') as YTD&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:06:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549909#M686505</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-01-03T16:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549910#M686506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change it a little, add floor():&lt;/P&gt;&lt;P&gt;LET vYTD =&lt;STRONG&gt;floor&lt;/STRONG&gt;(monthend(today(),-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; Some explanation.&lt;BR /&gt;Without floor, the variable returns date in format 12/31/2014.&amp;nbsp; When you use it this way - $(vYTD), it is calculated as 12 divide by 31 divide by 2014.&amp;nbsp; Not what you want.&amp;nbsp; So, you either use floor to keep it numeric, as it was before (the value of this date is 41639), or change all your $(vYTD) in expression to simple vYTD, so it doesn't calculate.&amp;nbsp; I think it is easier to change in one place.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:17:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Calendar-Script/m-p/549910#M686506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-03T16:17:13Z</dc:date>
    </item>
  </channel>
</rss>

