<?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(Date) Group By Load Script Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598532#M738260</link>
    <description>&lt;P&gt;All the fields you load along with Max(Date) statement (in the same load statement) need to be there in Group By clause.&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Max(Date) as Max,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F2, F3, .... Fn&lt;/P&gt;&lt;P&gt;from &amp;lt;&amp;gt; Group By F1, F2, F3, ....Fn;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // You might want to change the field order here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 09:47:08 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2019-07-03T09:47:08Z</dc:date>
    <item>
      <title>max(Date) Group By Load Script Error</title>
      <link>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598528#M738258</link>
      <description>&lt;P&gt;I need to load, by customer, the last date a product was ordered.&amp;nbsp; &amp;nbsp;The below script works fine, but obviously the max(Date) and Group By options are commented out.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;LatestOrders:&lt;BR /&gt;NOCONCATENATE LOAD&lt;BR /&gt;CustCode,&lt;BR /&gt;//Max(Date) as MaxDate,&lt;BR /&gt;Date,&lt;BR /&gt;Order,&lt;BR /&gt;OrderStatusH,&lt;BR /&gt;OrderInvStatusD,&lt;BR /&gt;ProductCode,&lt;BR /&gt;OrderSentqtyD,&lt;BR /&gt;ActCostD,&lt;BR /&gt;ActWsvD,&lt;BR /&gt;ActRsvD,&lt;BR /&gt;TaholaDateOrder&lt;BR /&gt;RESIDENT TempLatestOrderDetails;&lt;/P&gt;&lt;P&gt;//GROUP BY CustCode, ProductCode;&lt;/P&gt;&lt;P&gt;STORE LatestOrders INTO \\bi\Data\QVD\LatestOrders.qvd (QVD);&lt;/P&gt;&lt;P&gt;DROP Table TempLatestOrderDetails;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the script to include the max(Date) and Group By I get an INVALID EXPRESSION error:&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;LatestOrders:&lt;BR /&gt;NOCONCATENATE LOAD&lt;BR /&gt;CustCode,&lt;BR /&gt;Max(Date) as MaxDate,&lt;BR /&gt;//Date,&lt;BR /&gt;Order,&lt;BR /&gt;OrderStatusH,&lt;BR /&gt;OrderInvStatusD,&lt;BR /&gt;ProductCode,&lt;BR /&gt;OrderSentqtyD,&lt;BR /&gt;ActCostD,&lt;BR /&gt;ActWsvD,&lt;BR /&gt;ActRsvD,&lt;BR /&gt;TaholaDateOrder&lt;BR /&gt;RESIDENT TempLatestOrderDetails&lt;/P&gt;&lt;P&gt;GROUP BY CustCode, ProductCode;&lt;/P&gt;&lt;P&gt;STORE LatestOrders INTO \\bi\Data\QVD\LatestOrders.qvd (QVD);&lt;/P&gt;&lt;P&gt;DROP Table TempLatestOrderDetails;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm missing something obvious ....but can't work it out.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;P&gt;Many thanks for your help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598528#M738258</guid>
      <dc:creator>ljackson</dc:creator>
      <dc:date>2024-11-16T20:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: max(Date) Group By Load Script Error</title>
      <link>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598529#M738259</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;when using group by the fields you load&amp;nbsp;&lt;/P&gt;&lt;P&gt;need to be either in the group by part or&amp;nbsp;&lt;/P&gt;&lt;P&gt;loaded inside an aggr functions for example maxstring , only&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 09:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598529#M738259</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2019-07-03T09:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: max(Date) Group By Load Script Error</title>
      <link>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598532#M738260</link>
      <description>&lt;P&gt;All the fields you load along with Max(Date) statement (in the same load statement) need to be there in Group By clause.&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Max(Date) as Max,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F2, F3, .... Fn&lt;/P&gt;&lt;P&gt;from &amp;lt;&amp;gt; Group By F1, F2, F3, ....Fn;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // You might want to change the field order here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 09:47:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598532#M738260</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-07-03T09:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: max(Date) Group By Load Script Error</title>
      <link>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598547#M738261</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ahhhh ...that makes sense now.&amp;nbsp; &amp;nbsp;&amp;nbsp;Many thanks&lt;/P&gt;&lt;P&gt;I've simplified the script, and now it works perfectly:&lt;/P&gt;&lt;P&gt;LatestOrders:&lt;BR /&gt;LOAD&lt;BR /&gt;CustCode,&lt;BR /&gt;Max(Date) as MaxDate,&lt;BR /&gt;ProductCode&lt;BR /&gt;RESIDENT TempLatestOrderDetails&lt;/P&gt;&lt;P&gt;GROUP BY ProductCode, CustCode;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 10:08:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-Date-Group-By-Load-Script-Error/m-p/1598547#M738261</guid>
      <dc:creator>ljackson</dc:creator>
      <dc:date>2019-07-03T10:08:15Z</dc:date>
    </item>
  </channel>
</rss>

