<?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: Can't use max() function in script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402439#M612867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;max will work&amp;nbsp;&amp;nbsp; with group by &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Oct 2017 14:13:35 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2017-10-05T14:13:35Z</dc:date>
    <item>
      <title>Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402438#M612866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some problems to use the max() function in the script, in the frontend it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to find my maximu !m value of the field SCFI date. I have already formated a newly generated field which shows the dates numerical. But there is still an issue with calculating the maximum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max(SCFI_date_num) as SCFI_Max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script generator stops with the hint:"Invalid expression", which is totaly nonsense... why should the max() function does not work anymore?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help really appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402438#M612866</guid>
      <dc:creator>chriys1337</dc:creator>
      <dc:date>2017-10-05T14:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402439#M612867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;max will work&amp;nbsp;&amp;nbsp; with group by &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:13:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402439#M612867</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2017-10-05T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402440#M612868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chk sample&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/thread/52548" title="https://community.qlik.com/thread/52548"&gt;https://community.qlik.com/thread/52548&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:14:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402440#M612868</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2017-10-05T14:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402441#M612869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&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;FROM [Test.qvd] (qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join (Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Max(SCFI_date_num) as SCFI_Max&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:17:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402441#M612869</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-05T14:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402442#M612870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Max()&lt;/SPAN&gt; is an aggregation function. It aggregates values from multiple records into a single value.&lt;/P&gt;&lt;P&gt;You can use &lt;SPAN style="font-family: 'courier new', courier;"&gt;Max()&lt;/SPAN&gt; in a load script in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;With a &lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY&lt;/SPAN&gt; clause, as Chanty 4u suggested&lt;/LI&gt;&lt;LI&gt;Without a &lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY&lt;/SPAN&gt; clause. In that particular case, you'll search for a maximum value in an entire table and you cannot use any other fields in the same LOAD statement &lt;EM&gt;without passing them as parameter to an aggregation function.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, the &lt;SPAN style="font-family: 'courier new', courier;"&gt;Max()&lt;/SPAN&gt; function will be accepted if you omit the &lt;SPAN style="font-family: 'courier new', courier;"&gt;*,&lt;/SPAN&gt; part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:21:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402442#M612870</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-05T14:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402443#M612871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must load all fields, after, concatenate your specific field with expressions, etc&lt;/P&gt;&lt;P&gt;As in the attached file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;PRE class="tw-ta tw-text-medium tw-data-text" lang="en" style="padding: 0 0.14em 0 0; font-family: inherit; text-align: initial; font-size: 29px !important;"&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402443#M612871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-05T14:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402444#M612872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now that I think about it, you're always using a GROUP BY clause, whether explicitly specified or implied. In the second case, the implied clause is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Max() AS MaxField&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY &lt;STRONG&gt;Nothing&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which of course isn't valid script syntax. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:48:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402444#M612872</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-05T14:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use max() function in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402445#M612873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all, I know now what my mistake was (the missing group by). My solution to this is, to load the max value in a second load, as described by Sunny, but without joining it in the end. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:42:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-t-use-max-function-in-script/m-p/1402445#M612873</guid>
      <dc:creator>chriys1337</dc:creator>
      <dc:date>2017-10-11T11:42:23Z</dc:date>
    </item>
  </channel>
</rss>

