<?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: Max Function not working in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696459#M1055930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if your primary key is in string format then use the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD Maxstring(PriKeyItem) AS "maxPK" Resident Item;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Oct 2014 15:59:50 GMT</pubDate>
    <dc:creator>preminqlik</dc:creator>
    <dc:date>2014-10-25T15:59:50Z</dc:date>
    <item>
      <title>Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696455#M1055926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on an incremental load script and need to obtain the last Primary Key loaded (originates from an identify column in SQL).&lt;/P&gt;&lt;P&gt;In the below script I can not get Max(PriKeyItem) to return any results into the vMaxKey variable.&amp;nbsp; If I change Max to Count results are obtained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Item:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxPriKey:&lt;/P&gt;&lt;P&gt;LOAD Max('PriKeyItem') AS "maxPK" Resident Item;&lt;/P&gt;&lt;P&gt;LET vMaxKey = FieldValue('maxPK',1);&lt;/P&gt;&lt;P&gt;//LET vMaxKey=peek('maxPK',-1,'MaxPriKey');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any suggestions -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brett&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 14:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696455#M1055926</guid>
      <dc:creator />
      <dc:date>2014-10-25T14:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696456#M1055927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TableName:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &lt;C&gt; (qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MaxPriKey:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Max(PriKeyItem) AS maxPK Resident TableName;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vMaxKey = Peek('maxPK',0,'MaxPriKey');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 15:33:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696456#M1055927</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-10-25T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696457#M1055928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dont use single quotes in max function otherwise it will take it as text and max will not work use below&lt;/P&gt;&lt;P&gt;&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;Item:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &lt;C&gt; (qvd);&lt;/C&gt;&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;MaxPriKey:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Max(PriKeyItem) AS "maxPK" Resident Item;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vMaxKey = FieldValue('maxPK',1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;//LET vMaxKey=peek('maxPK',-1,'MaxPriKey');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 15:52:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696457#M1055928</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-10-25T15:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696458#M1055929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys.&amp;nbsp;&amp;nbsp; I could have sworn the count function worked with the single quotes (and returned a value &amp;gt; 1) but maybe not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 15:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696458#M1055929</guid>
      <dc:creator />
      <dc:date>2014-10-25T15:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696459#M1055930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if your primary key is in string format then use the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD Maxstring(PriKeyItem) AS "maxPK" Resident Item;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 15:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696459#M1055930</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2014-10-25T15:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Max Function not working in script</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696460#M1055931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Use distinct for the second table, you could be getting more than one value for &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;Max(PriKeyItem) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TableName:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &lt;C&gt; (qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MaxPriKey:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NoConcatenate&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Distinct Max(PriKeyItem) AS maxPK Resident TableName;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vMaxKey = Peek('maxPK');&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Function-not-working-in-script/m-p/696460#M1055931</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2014-10-27T18:32:09Z</dc:date>
    </item>
  </channel>
</rss>

