<?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 Incorrect Figure when using Group by Clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Incorrect-Figure-when-using-Group-by-Clause/m-p/1323095#M842518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am encountering an issue, i have the below file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1234.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161327_1234.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Here is the below script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num (Trim([QTY]),'#,##0', '.' , ',') as PRQTY&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\QVData\QVLive\PRCODES_O.QVD]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE PRCODE='O002';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, what I am trying to do, is get the sum of PRQTY and Group it by DOCID.&amp;nbsp; When I try the below code, it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE PRCODE='O002'&lt;/P&gt;&lt;P&gt;group by DOCID,ITEMID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="33333.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/161329_33333.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I Exclude ITEMID in the script, the PRQTY amounts to&amp;nbsp; -3483 which is incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be as it is in the first screencapture.&amp;nbsp; Ive tried Rangesum etc.&amp;nbsp; But this only results in the object no displaying any data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Incorrect Figure when using Group by Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Incorrect-Figure-when-using-Group-by-Clause/m-p/1323095#M842518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am encountering an issue, i have the below file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1234.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161327_1234.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Here is the below script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num (Trim([QTY]),'#,##0', '.' , ',') as PRQTY&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\QVData\QVLive\PRCODES_O.QVD]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE PRCODE='O002';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, what I am trying to do, is get the sum of PRQTY and Group it by DOCID.&amp;nbsp; When I try the below code, it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE PRCODE='O002'&lt;/P&gt;&lt;P&gt;group by DOCID,ITEMID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="33333.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/161329_33333.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I Exclude ITEMID in the script, the PRQTY amounts to&amp;nbsp; -3483 which is incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be as it is in the first screencapture.&amp;nbsp; Ive tried Rangesum etc.&amp;nbsp; But this only results in the object no displaying any data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incorrect-Figure-when-using-Group-by-Clause/m-p/1323095#M842518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Figure when using Group by Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Incorrect-Figure-when-using-Group-by-Clause/m-p/1323096#M842519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what it seems that you have a combination of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DOCID and &lt;/SPAN&gt;ITEMID repeating 27 times in your dashboard.... that is why when you sum in the script you are getting 135 (5*27), 108 (4*27), 270 (10*27)... etc.... May be you need to add distinct? or use Only?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Only&lt;/SPAN&gt;(Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;C&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;WHERE PRCODE='O002'&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;group by DOCID,ITEMID;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;or&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOCID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEMID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(&lt;SPAN style="color: #ff0000;"&gt;DISTINCT&lt;/SPAN&gt; Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;C&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;WHERE PRCODE='O002'&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;group by DOCID,ITEMID;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incorrect-Figure-when-using-Group-by-Clause/m-p/1323096#M842519</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-26T12:43:51Z</dc:date>
    </item>
  </channel>
</rss>

