<?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 in Load Script without creating resident table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545614#M744496</link>
    <description>&lt;P&gt;You forgot to add other fields in Group by clause. That's why it is throwing error.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Feb 2019 05:59:47 GMT</pubDate>
    <dc:creator>shiveshsingh</dc:creator>
    <dc:date>2019-02-18T05:59:47Z</dc:date>
    <item>
      <title>Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545554#M744494</link>
      <description>&lt;P&gt;Hi Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wondering can &lt;STRONG&gt;Max function&lt;/STRONG&gt; be used in load script without creating a&lt;STRONG&gt; Resident Table&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ID,&lt;BR /&gt;grade,&lt;BR /&gt;date,&lt;BR /&gt;max(date) as NewDate&lt;BR /&gt;&lt;BR /&gt;FROM ……..\SourceData.xlsx] (ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;Group By ID;&lt;/P&gt;&lt;P&gt;This comes up as &lt;STRONG&gt;Invalid Expression&lt;/STRONG&gt;. With resident table it works file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Saif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545554#M744494</guid>
      <dc:creator>saifuddin</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545558#M744495</link>
      <description>&lt;P&gt;Aggregation during load requires that you define how the aggregation is expected to be grouped. Meaning that you need to define over which dimensions you want the table to be aggregated over, which is done through GROUP BY.&lt;BR /&gt;&lt;BR /&gt;Fields defined in the load statement must be aggregations or be included i GROUP BY. In your example the fields grade and date are not following this rule, and I expect that is why the reload fails. &lt;BR /&gt;&lt;BR /&gt;The structure of your script really depends on what you are trying to accomplish. This could be one way to add an aggregated max value to your data model, in two separate tables associated over the ID field. &lt;BR /&gt;&lt;BR /&gt;MyTable:&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM ……..\SourceData.xlsx] (ooxml, embedded labels, table is Sheet1)&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;max(date) as NewDate&lt;BR /&gt;Resident MyTable&lt;BR /&gt;Group By ID;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 03:01:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545558#M744495</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2019-02-25T03:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545614#M744496</link>
      <description>&lt;P&gt;You forgot to add other fields in Group by clause. That's why it is throwing error.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 05:59:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1545614#M744496</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2019-02-18T05:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1546070#M744497</link>
      <description>&lt;P&gt;Hi Tko,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. That explain why I was getting invalid expression. The table I am trying to use Max Function, it has more than 25 fields. I guess it won't be ideal to use all these fields under Group By clause.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already used your solution 2,&amp;nbsp; which creates a synthetic as I am using more than 1 fields as Group By. Not a big fan of synthetic key.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 23:07:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1546070#M744497</guid>
      <dc:creator>saifuddin</dc:creator>
      <dc:date>2019-02-18T23:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1548484#M744498</link>
      <description>My example should not lead to synthetic key, as it only has one common key field. &lt;BR /&gt;&lt;BR /&gt;If you has multiple key field, you could either join the result back to the base table or create a composite key in the base table and use that as the common key field.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Feb 2019 03:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1548484#M744498</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2019-02-25T03:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Max function in Load Script without creating resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1548958#M744499</link>
      <description>&lt;P&gt;Thanks I am able to avoid &lt;SPAN&gt;synthetic&amp;nbsp;by using join.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 03:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-function-in-Load-Script-without-creating-resident-table/m-p/1548958#M744499</guid>
      <dc:creator>saifuddin</dc:creator>
      <dc:date>2019-02-26T03:33:32Z</dc:date>
    </item>
  </channel>
</rss>

