<?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 variable LET script error in Qlik Learning Discussions</title>
    <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813618#M2723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! Can someone explain me, please, why does &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMonthStart=MonthStart(max(Date));&lt;/P&gt;&lt;P&gt;//Date is a field of previously loaded table&lt;/P&gt;&lt;P&gt;cause a script line error?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alexa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 10:07:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-11T10:07:37Z</dc:date>
    <item>
      <title>variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813618#M2723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! Can someone explain me, please, why does &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMonthStart=MonthStart(max(Date));&lt;/P&gt;&lt;P&gt;//Date is a field of previously loaded table&lt;/P&gt;&lt;P&gt;cause a script line error?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alexa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 10:07:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813618#M2723</guid>
      <dc:creator />
      <dc:date>2014-12-11T10:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813619#M2724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems correct statement check the date format of Date field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try for check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=MonthStart(max(Today()))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 10:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813619#M2724</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-12-11T10:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813620#M2725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anand, thak you for your answer!&lt;/P&gt;&lt;P&gt;I tried to fix it..&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;With code like this&lt;/P&gt;&lt;TABLE style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;TempTable1:&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;TABLE style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;Max( Date) as MaxDate&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident FACT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let vMaxDateNum = Num( Peek( 'MaxDate', 0, 'TempTable1'));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let vMaxDate = Date( $(vMaxDateNum));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vMonthStart=MonthStart(FieldValue('MaxDate', 1));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vPeriod=$(vMaxDate)-$(vMonthStart);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I get another&amp;nbsp; error "script line error LET vPeriod=08.12.2014-01.12.2014"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 10:44:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813620#M2725</guid>
      <dc:creator />
      <dc:date>2014-12-11T10:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813621#M2726</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;Let evaluates the statement on the RHS before assigning it to the variable. Max(Date) is not a legal statement in script mode outside of a LOAD, so this statement is causing an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your error in the second post - you need quotes around the date variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LET vPeriod='$(vMaxDate)'-'$(vMonthStart)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jonathan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 10:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813621#M2726</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-12-11T10:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813622#M2727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,Jonathan! thanks for explanation!!&lt;/P&gt;&lt;P&gt;I made it as you wrote. Now I dont get an error? but it doesnt calculate Period=(&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TempTable1:&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; Max( Date) as MaxDate&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Resident FACT;&lt;/P&gt;&lt;P&gt;Let vMaxDateNum = Num( Peek( 'MaxDate', 0, 'TempTable1'));&lt;/P&gt;&lt;P&gt;Let vMaxDate = Date( $(vMaxDateNum));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempTabl2:&lt;/P&gt;&lt;P&gt;Load MonthStart(FieldValue('MaxDate', 1)) as MonthStart,&lt;/P&gt;&lt;P&gt;MonthEnd(FieldValue('MaxDate', 1)) as MonthEnd&lt;/P&gt;&lt;P&gt;resident TempTable1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMonthStartNum = round(Num( Peek( 'MonthStart', 0, 'TempTable2')));&lt;/P&gt;&lt;P&gt;Let vMonthEndNum= round(Num( Peek( 'MonthEnd', 0, 'TempTable2')));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vPeriod='$(vMaxDateNum )'-'$(vMonthStartNum)';&lt;/P&gt;&lt;P&gt;LET vDaysMonth='$(vMonthEndNum)'-'$(vMonthStartNum)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with code like this thats what I see&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/73221_pastedImage_11.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 11:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813622#M2727</guid>
      <dc:creator />
      <dc:date>2014-12-11T11:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: variable LET script error</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813623#M2728</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 have changed the definition of the two variables to numbers, so you no longer need expansions and quotes. I think you have a trailing space in the Let vPeriod statement that is causing your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simplify these two statements to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vPeriod = vMaxDateNum - vMonthStartNum;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vDaysMonth = vMonthEndNum - vMonthStartNum;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 08:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/variable-LET-script-error/m-p/813623#M2728</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-12-15T08:41:56Z</dc:date>
    </item>
  </channel>
</rss>

