<?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 declaring a variable in script using LET in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755979#M664133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax is correct I think that the problem comes from the load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENCH_DTE:&lt;/P&gt;&lt;P&gt;LOAD BASE.DATE as DATE&lt;/P&gt;&lt;P&gt;resident BSE&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;month(BSE.DATE) = 'Dec'&lt;/P&gt;&lt;P&gt;ORDER BY BSE.DATE ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you use BSE. while after the LOAD you use BASE. ??? Shouldn't they be the same prefix?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jan 2015 15:25:53 GMT</pubDate>
    <dc:creator>alexandros17</dc:creator>
    <dc:date>2015-01-08T15:25:53Z</dc:date>
    <item>
      <title>Problem declaring a variable in script using LET</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755978#M664132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following code in script:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;BENCH_DTE:&lt;/P&gt;
&lt;P&gt;LOAD BASE.DATE as DATE&lt;/P&gt;
&lt;P&gt;resident BSE&lt;/P&gt;
&lt;P&gt;WHERE&lt;/P&gt;
&lt;P&gt;month(BSE.DATE) = 'Dec'&lt;/P&gt;
&lt;P&gt;ORDER BY BSE.DATE ASC&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;Let vbench_dte2 = Fieldvalue('DATE',1);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET vbench_dte = peek('DATE',0,'BENCH_DTE');&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After stepping through the code it seems both variables are been declared as NULL.&amp;nbsp; There are 2 rows in table BENCH_DTE with the values 31/12/2013 &amp;amp; 31/12/2014.&amp;nbsp; What I am trying to do is to assign the minimum date, hence the reason for the ORDER BY statement i.e. I require 31/12/2013 to be assigned to the variables.&amp;nbsp; Is the above syntax correct for FIELDVALUE AND PEEK?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755978#M664132</guid>
      <dc:creator />
      <dc:date>2015-01-08T15:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem declaring a variable in script using LET</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755979#M664133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax is correct I think that the problem comes from the load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENCH_DTE:&lt;/P&gt;&lt;P&gt;LOAD BASE.DATE as DATE&lt;/P&gt;&lt;P&gt;resident BSE&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;month(BSE.DATE) = 'Dec'&lt;/P&gt;&lt;P&gt;ORDER BY BSE.DATE ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you use BSE. while after the LOAD you use BASE. ??? Shouldn't they be the same prefix?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755979#M664133</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-01-08T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem declaring a variable in script using LET</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755980#M664136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is Qualify on before table &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;BENCH_DTE table? If yes, then try &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;Let vbench_dte2 = Fieldvalue('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;BENCH_DTE.&lt;/STRONG&gt;&lt;/SPAN&gt;DATE',1);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755980#M664136</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-01-08T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem declaring a variable in script using LET</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755981#M664141</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 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;BENCH_DTE:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FIRST 1 LOAD BASE.DATE as DATE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;resident BSE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;month(BSE.DATE) = 'Dec'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ORDER BY BSE.DATE ASC&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;LET NumRows=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i=1 to $(NumRows)&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vbench_dte2&lt;/SPAN&gt;=FieldValue('DATE',$(i));&lt;/P&gt;&lt;P&gt;//do some stuff....&lt;/P&gt;&lt;P&gt;NEXT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pay attention: you can use FIRST 1 to select only 1 row if you order the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-declaring-a-variable-in-script-using-LET/m-p/755981#M664141</guid>
      <dc:creator>simospa</dc:creator>
      <dc:date>2015-01-08T15:42:40Z</dc:date>
    </item>
  </channel>
</rss>

