<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380504#M808482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Iam trying to execitive the below script ..&lt;/P&gt;&lt;P&gt;here iam trying to create a variable which should hold the max value for the field&lt;/P&gt;&lt;P&gt;callDate,&lt;/P&gt;&lt;P&gt;and in where condion for the field CallDate iam trying to pass that value of the variable .&lt;/P&gt;&lt;P&gt;but this is showing some error while executing ..&amp;nbsp; can you please let me know where i am wrong &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;let vdate=max(CallDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Test :&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Department,&lt;/P&gt;&lt;P&gt;Revenue,&lt;/P&gt;&lt;P&gt;CallDate,&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;where CallDate=$(vdate);&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>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>smilingjohn</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380504#M808482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Iam trying to execitive the below script ..&lt;/P&gt;&lt;P&gt;here iam trying to create a variable which should hold the max value for the field&lt;/P&gt;&lt;P&gt;callDate,&lt;/P&gt;&lt;P&gt;and in where condion for the field CallDate iam trying to pass that value of the variable .&lt;/P&gt;&lt;P&gt;but this is showing some error while executing ..&amp;nbsp; can you please let me know where i am wrong &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;let vdate=max(CallDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Test :&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Department,&lt;/P&gt;&lt;P&gt;Revenue,&lt;/P&gt;&lt;P&gt;CallDate,&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;where CallDate=$(vdate);&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>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380504#M808482</guid>
      <dc:creator>smilingjohn</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380505#M808483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Try like this&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vdate=Date(max(CallDate));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Test :&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Department,&lt;/P&gt;&lt;P&gt;Revenue,&lt;/P&gt;&lt;P&gt;CallDate,&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;FROM &lt;D&gt; (qvd)&lt;/D&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where CallDate=date('$(vdate)');&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 09:50:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380505#M808483</guid>
      <dc:creator>devarasu07</dc:creator>
      <dc:date>2017-10-17T09:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380506#M808484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a load script, function &lt;SPAN style="font-family: 'courier new', courier;"&gt;Max()&lt;/SPAN&gt; cannot be used outside a LOAD/SELECT statement. The way you apply this function, it will always return NULL. Assigning NULL to a variable will delete the variable (if it hasn't been created in the User Interface). So your WHERE claus will become something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE CallDate = ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is incorrect syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good thing we can see the error message on your screen, without you showing us, ain't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the first statement into something like this. Note that CallDate must be present in an Internal Table before this will work.&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(CallDate) AS MaxCallDate &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT SourceTableWhereCallDateResides;&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 vdate = num(peek('MaxCallDate'));&lt;/SPAN&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;P&gt;&lt;/P&gt;&lt;P&gt;[Edit] Improved formatting a bit to make the code examples stand out...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 09:52:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380506#M808484</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-17T09:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380507#M808485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it says script line error&amp;nbsp; for &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;let vdate=Date(max(CallDate));&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 09:55:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380507#M808485</guid>
      <dc:creator>smilingjohn</dc:creator>
      <dc:date>2017-10-17T09:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380508#M808486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First you have to find the Max Date from your fact / source table. try like below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MaxDate: // it's used to get the&amp;nbsp; max date from test.qvd file&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Date(max(CallDate)) as MaxDate &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM &lt;D&gt; (qvd);&lt;/D&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vdate=Peek('MaxDate'); // fetch the value of a field from a previous record &amp;amp; let will store the value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop table MaxDate;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Department,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Revenue,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CallDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM &lt;D&gt; (qvd)&lt;/D&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where CallDate=date('$(vdate)');&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 10:03:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380508#M808486</guid>
      <dc:creator>devarasu07</dc:creator>
      <dc:date>2017-10-17T10:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380509#M808487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it Devarasu . &lt;/P&gt;&lt;P&gt;Thanks ...&lt;/P&gt;&lt;P&gt;Can you please look into my one of the post WHich is TOTAL...&lt;/P&gt;&lt;P&gt;will be really helpfulll &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 10:07:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380509#M808487</guid>
      <dc:creator>smilingjohn</dc:creator>
      <dc:date>2017-10-17T10:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://community.qlik.com/t5/QlikView/variable/m-p/1380510#M808488</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;Please find the attached QlikView document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your requirement will be resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 10:30:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable/m-p/1380510#M808488</guid>
      <dc:creator />
      <dc:date>2017-10-17T10:30:30Z</dc:date>
    </item>
  </channel>
</rss>

