<?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: Why do I get an invalid expression error when trying to use sum and group by? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705699#M254434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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 text(inventory_num) as inv_num, sum(amt_paid) as amt_paid_2014_06 FROM C:\Downloads\invpaid.txt (txt, codepage is 1252, embedded labels, delimiter is '~') GROUP by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;text(inventory_num)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;you cannot use alias ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 13:02:14 GMT</pubDate>
    <dc:creator>alexandros17</dc:creator>
    <dc:date>2014-07-18T13:02:14Z</dc:date>
    <item>
      <title>Why do I get an invalid expression error when trying to use sum and group by?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705698#M254433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following as my load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD text(inventory_num) as inv_num, sum(amt_paid) as amt_paid_2014_06 FROM C:\Downloads\invpaid.txt (txt, codepage is 1252, embedded labels, delimiter is '~') GROUP by inv_num;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The invpaid.txt file has inventory numbers and the amount paid for each number. Sometimes there are multiple payments per inventory number. I want to consolidate the data so that I have only unique inventory numbers with the total amount paid for each number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;inv_num&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;amt_paid&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above table should turn into&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;inv_num&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;amt_paid&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 12:55:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705698#M254433</guid>
      <dc:creator />
      <dc:date>2014-07-18T12:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get an invalid expression error when trying to use sum and group by?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705699#M254434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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 text(inventory_num) as inv_num, sum(amt_paid) as amt_paid_2014_06 FROM C:\Downloads\invpaid.txt (txt, codepage is 1252, embedded labels, delimiter is '~') GROUP by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;text(inventory_num)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;you cannot use alias ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 13:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705699#M254434</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-07-18T13:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get an invalid expression error when trying to use sum and group by?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705700#M254435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this :&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 text(inventory_num) as inv_num, sum(amt_paid) as amt_paid_2014_06 FROM C:\Downloads\invpaid.txt (txt, codepage is 1252, embedded labels, delimiter is '~') GROUP by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;EM style="color: #ff0000;"&gt;inventory_num&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 13:03:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705700#M254435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-18T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get an invalid expression error when trying to use sum and group by?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705701#M254436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are grouping by a field that has not yet been defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&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 text(inventory_num) as inv_num, sum(amt_paid) as amt_paid_2014_06 FROM C:\Downloads\invpaid.txt (txt, codepage is 1252, embedded labels, delimiter is '~') GROUP by inventory_num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;SKG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 13:04:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705701#M254436</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2014-07-18T13:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get an invalid expression error when trying to use sum and group by?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705702#M254437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bill! Your solution worked. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/love.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 13:06:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-do-I-get-an-invalid-expression-error-when-trying-to-use-sum/m-p/705702#M254437</guid>
      <dc:creator />
      <dc:date>2014-07-18T13:06:46Z</dc:date>
    </item>
  </channel>
</rss>

