<?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: Creating a variable in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074097#M934828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use SET statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vmaxdate = max(Date);&lt;/P&gt;&lt;P&gt;Set vmaxdate2 = '=max(Date)';&lt;/P&gt;&lt;P&gt;Set vmaxdate3 = =max(Date);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Feb 2016 20:06:51 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-02-19T20:06:51Z</dc:date>
    <item>
      <title>Creating a variable in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074094#M934825</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 a quick question.I am able to create a variable using &lt;STRONG&gt;variable overview&lt;/STRONG&gt; but unable to create it using the script. I know it is silly question. Just wanted to know why I am unable to create in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculation Used:&lt;/P&gt;&lt;P&gt;vmaxdate = max(Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Varun Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 16:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074094#M934825</guid>
      <dc:creator>varunreddy</dc:creator>
      <dc:date>2016-02-19T16:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074095#M934826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two reasons&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Script aggregation functions can only be used in LOAD statements.&lt;/LI&gt;&lt;LI&gt;Because you use max() outside of any LOAD statement, it will return the NULL value. Assigning NULL to a variable will effectively delete the variable (if you didn't create it in the Variable Overview first)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, for instance, field Date is present in a resident table called Calendar, you better use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MinMaxTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD max(Date) AS vMaxDate&amp;nbsp; // Creates a single row with a single value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Calendar;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vmaxdate = peek('vMaxDate'); // peek into the table and get that single value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DROP Table MinMaxTable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 19:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074095#M934826</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-02-19T19:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074096#M934827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Varun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 20:04:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074096#M934827</guid>
      <dc:creator>varunreddy</dc:creator>
      <dc:date>2016-02-19T20:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074097#M934828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use SET statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vmaxdate = max(Date);&lt;/P&gt;&lt;P&gt;Set vmaxdate2 = '=max(Date)';&lt;/P&gt;&lt;P&gt;Set vmaxdate3 = =max(Date);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 20:06:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-in-the-script/m-p/1074097#M934828</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-19T20:06:51Z</dc:date>
    </item>
  </channel>
</rss>

