<?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 Setting a variable within the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379888#M141713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Afternoon all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just wondering if the following is at possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to set the variable vMaxDate to the maximum date from a list of measures within a QVD, the list of measures is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KPI&amp;nbsp; &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;UploadDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actual&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;Budget&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;FTE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;Leavers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/07/2012&lt;/P&gt;&lt;P&gt;Vacancies&amp;nbsp;&amp;nbsp; 29/07/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want vMaxDate to be the maximum value for the KPI Actual....can anyone out there help please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2012 11:37:49 GMT</pubDate>
    <dc:creator>samvile18</dc:creator>
    <dc:date>2012-08-22T11:37:49Z</dc:date>
    <item>
      <title>Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379888#M141713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Afternoon all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just wondering if the following is at possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to set the variable vMaxDate to the maximum date from a list of measures within a QVD, the list of measures is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KPI&amp;nbsp; &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;UploadDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actual&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;Budget&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;FTE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;Leavers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/07/2012&lt;/P&gt;&lt;P&gt;Vacancies&amp;nbsp;&amp;nbsp; 29/07/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want vMaxDate to be the maximum value for the KPI Actual....can anyone out there help please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 11:37:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379888#M141713</guid>
      <dc:creator>samvile18</dc:creator>
      <dc:date>2012-08-22T11:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379889#M141714</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;First load the data into the QVW file, and then create a variable in Settings - Variable Overview and create new variable with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(Max({1}UploadDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as expression this will always fetch the maximum date. i.e, (31/07/2012) irrespective of selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379889#M141714</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-08-22T12:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379890#M141715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I thought it might look like, the problem I have though is I only want to use the value that's associated with the Actual KPI. The reason for this is because there may be another KPI with a later date that I don't want to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379890#M141715</guid>
      <dc:creator>samvile18</dc:creator>
      <dc:date>2012-08-22T12:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379891#M141716</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;then you could create a temporary table in your load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;Load Max(UploadDate) As max_actual_upload_date&lt;/P&gt;&lt;P&gt;Resident &amp;lt;name_of_table&amp;gt;&lt;/P&gt;&lt;P&gt;Where KPI='Actual';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxDate=Peek('max_actual_upload_date');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379891#M141716</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2012-08-22T12:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379892#M141717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I do at the moment, the issue I have is when there is another KPI with a different date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Actual&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/07/2012&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Budget&amp;nbsp;&amp;nbsp;&amp;nbsp; 06/08/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the max command I end up setting the variable value as 06/08/2012, I don't want this to happen. I only want the variable to be the value of the Actual KPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379892#M141717</guid>
      <dc:creator>samvile18</dc:creator>
      <dc:date>2012-08-22T12:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable within the script</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379893#M141718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chaps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to let you know, I figured it out...like everything I was thinking too complex and all I needed to do was add a where clause to the temp table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempUploadMonth:&lt;/P&gt;&lt;P&gt;Load Distinct&lt;/P&gt;&lt;P&gt;Max(UploadDate) as MaxDate&lt;/P&gt;&lt;P&gt;Resident UploadMonth&lt;/P&gt;&lt;P&gt;Where KPI='Actual';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for taking the time to look at this with me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-within-the-script/m-p/379893#M141718</guid>
      <dc:creator>samvile18</dc:creator>
      <dc:date>2012-08-22T12:45:10Z</dc:date>
    </item>
  </channel>
</rss>

