<?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 SUM during load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SUM-during-load/m-p/218162#M71327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To do a sum() or other aggregation expression in the script, you need a GROUP BY. So you'll need to group by that whole list of fields in the load statement. As an alternative, it might be more efficient to do the group by in the SQL rather than in the LOAD.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LOAD `GL_Account`,&lt;BR /&gt; TranDate,&lt;BR /&gt;...&lt;BR /&gt; TOTAL_REV&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT&lt;BR /&gt; &amp;lt;all fields but REV&amp;gt;&lt;BR /&gt;,sum(REV) as TOTAL_REV&lt;BR /&gt;FROM minitrac.mpglcn&lt;BR /&gt;WHERE year(TranDate) &amp;lt;&amp;gt; "2030"&lt;BR /&gt;GROUP BY&lt;BR /&gt; &amp;lt;all fields but REV&amp;gt;&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jan 2010 02:12:57 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-01-21T02:12:57Z</dc:date>
    <item>
      <title>SUM during load</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-during-load/m-p/218161#M71326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm a bit slow. Can somebody help me on summing during load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;ODBC CONNECT TO minitrac (XUserId is KBSeeUROeB, XPassword is GdfaIWFNGDdeWbFGUDbB);&lt;BR /&gt;GM:&lt;BR /&gt;LOAD `GL_Account`,&lt;BR /&gt; TranDate,&lt;BR /&gt;&lt;BR /&gt; TranNo,&lt;BR /&gt; `Control_No`,&lt;BR /&gt; HistUpd,&lt;BR /&gt; xglacctno,&lt;BR /&gt; xtrandate,&lt;BR /&gt; REGION,&lt;BR /&gt; MAKE,&lt;BR /&gt; MODEL,&lt;BR /&gt; purgechar (SERIAL,'GM') as SERIAL,&lt;BR /&gt; DIVISION,&lt;BR /&gt; `HR_METER`,&lt;BR /&gt; `LAST_HR_METER`,&lt;BR /&gt; REV,&lt;BR /&gt; REP,&lt;BR /&gt; CUSTOMER,&lt;BR /&gt; `GM_EXP`,&lt;BR /&gt; `GM_START`,&lt;BR /&gt; BRANCH,&lt;BR /&gt; `UNIT_OPTIONS`,&lt;BR /&gt; `GM_PAYMENT`,&lt;BR /&gt; `LEASE_PAYMENT`,&lt;BR /&gt; CAHRS,&lt;BR /&gt; `LEASE_RESIDUAL`,&lt;BR /&gt; `LEASE_EXPDATE`,&lt;BR /&gt; `OT_RATE`,&lt;BR /&gt; `OT_INTERVAL`,&lt;BR /&gt; `CONTRACT_GP`',&lt;BR /&gt; SUM(REV) as TOTAL_REV;&lt;BR /&gt;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM minitrac.mpglcn where Year(TranDate) &amp;lt;&amp;gt; "2030";&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I get an error when the SUM(REV) as TOTAL_REV is in the load script. Am I doing something wrong? I did a lot of searches, and I think I have to calculate the SUM(REV) on another load statement. However, I'm not a SQL person by any means.&lt;/P&gt;&lt;P&gt;Any help is much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 17:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-during-load/m-p/218161#M71326</guid>
      <dc:creator />
      <dc:date>2010-01-20T17:55:59Z</dc:date>
    </item>
    <item>
      <title>SUM during load</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-during-load/m-p/218162#M71327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To do a sum() or other aggregation expression in the script, you need a GROUP BY. So you'll need to group by that whole list of fields in the load statement. As an alternative, it might be more efficient to do the group by in the SQL rather than in the LOAD.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LOAD `GL_Account`,&lt;BR /&gt; TranDate,&lt;BR /&gt;...&lt;BR /&gt; TOTAL_REV&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT&lt;BR /&gt; &amp;lt;all fields but REV&amp;gt;&lt;BR /&gt;,sum(REV) as TOTAL_REV&lt;BR /&gt;FROM minitrac.mpglcn&lt;BR /&gt;WHERE year(TranDate) &amp;lt;&amp;gt; "2030"&lt;BR /&gt;GROUP BY&lt;BR /&gt; &amp;lt;all fields but REV&amp;gt;&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 02:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-during-load/m-p/218162#M71327</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-01-21T02:12:57Z</dc:date>
    </item>
  </channel>
</rss>

