<?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 result is showing double then sql result. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622069#M734547</link>
    <description>&lt;P&gt;i have a incremental table , script is :-&lt;/P&gt;&lt;P&gt;max1:&lt;BR /&gt;LOAD max (SalesDate) as SalesDate&lt;BR /&gt;FROM&lt;BR /&gt;[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd](qvd);&lt;/P&gt;&lt;P&gt;let date2=Date(peek('SalesDate',0,'max'));&lt;/P&gt;&lt;P&gt;drop table max1;&lt;/P&gt;&lt;P&gt;final1:&lt;BR /&gt;LOAD NCode,&lt;BR /&gt;PartnerCode,&lt;BR /&gt;Channel,&lt;BR /&gt;ETPCode,&lt;BR /&gt;SalesDate,&lt;BR /&gt;"Doc_Type",&lt;BR /&gt;BillNo,&lt;BR /&gt;CustomerNumber,&lt;BR /&gt;Season,&lt;BR /&gt;Style,&lt;BR /&gt;Color,&lt;BR /&gt;Size,&lt;BR /&gt;InvoiceQuantity,&lt;BR /&gt;ETPMRP,&lt;BR /&gt;RealisedSale,&lt;BR /&gt;TAXAmount,&lt;BR /&gt;TAXRate,&lt;BR /&gt;NETSale,&lt;BR /&gt;SalesPerson;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM ETPEASV55.dbo."VWCashOrderTRN_Qlik" where SalesDate&amp;gt;'$(date2)';&lt;/P&gt;&lt;P&gt;Concatenate(final1)&lt;BR /&gt;LOAD NCode,&lt;BR /&gt;PartnerCode,&lt;BR /&gt;Channel,&lt;BR /&gt;ETPCode,&lt;BR /&gt;SalesDate,&lt;BR /&gt;Doc_Type,&lt;BR /&gt;BillNo,&lt;BR /&gt;CustomerNumber,&lt;BR /&gt;Season,&lt;BR /&gt;Style,&lt;BR /&gt;Color,&lt;BR /&gt;Size,&lt;BR /&gt;InvoiceQuantity,&lt;BR /&gt;ETPMRP,&lt;BR /&gt;RealisedSale,&lt;BR /&gt;TAXAmount,&lt;BR /&gt;TAXRate,&lt;BR /&gt;NETSale,&lt;BR /&gt;SalesPerson&lt;BR /&gt;FROM&lt;BR /&gt;[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;now i have done table chart in which i want to do sum(realisedsale) on the basis of ncodes&lt;/P&gt;&lt;P&gt;the result of sum(realisedsale) is 10000&lt;/P&gt;&lt;P&gt;but when i verify sum(realisedsale) in my sql table its showing 5000&lt;/P&gt;&lt;P&gt;so qlikview is showing exactly double data.&lt;/P&gt;&lt;P&gt;also double data is in every column of qlikview like sum(invoicequantity) , etc&lt;/P&gt;&lt;P&gt;please any help.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>riishabhz</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622069#M734547</link>
      <description>&lt;P&gt;i have a incremental table , script is :-&lt;/P&gt;&lt;P&gt;max1:&lt;BR /&gt;LOAD max (SalesDate) as SalesDate&lt;BR /&gt;FROM&lt;BR /&gt;[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd](qvd);&lt;/P&gt;&lt;P&gt;let date2=Date(peek('SalesDate',0,'max'));&lt;/P&gt;&lt;P&gt;drop table max1;&lt;/P&gt;&lt;P&gt;final1:&lt;BR /&gt;LOAD NCode,&lt;BR /&gt;PartnerCode,&lt;BR /&gt;Channel,&lt;BR /&gt;ETPCode,&lt;BR /&gt;SalesDate,&lt;BR /&gt;"Doc_Type",&lt;BR /&gt;BillNo,&lt;BR /&gt;CustomerNumber,&lt;BR /&gt;Season,&lt;BR /&gt;Style,&lt;BR /&gt;Color,&lt;BR /&gt;Size,&lt;BR /&gt;InvoiceQuantity,&lt;BR /&gt;ETPMRP,&lt;BR /&gt;RealisedSale,&lt;BR /&gt;TAXAmount,&lt;BR /&gt;TAXRate,&lt;BR /&gt;NETSale,&lt;BR /&gt;SalesPerson;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM ETPEASV55.dbo."VWCashOrderTRN_Qlik" where SalesDate&amp;gt;'$(date2)';&lt;/P&gt;&lt;P&gt;Concatenate(final1)&lt;BR /&gt;LOAD NCode,&lt;BR /&gt;PartnerCode,&lt;BR /&gt;Channel,&lt;BR /&gt;ETPCode,&lt;BR /&gt;SalesDate,&lt;BR /&gt;Doc_Type,&lt;BR /&gt;BillNo,&lt;BR /&gt;CustomerNumber,&lt;BR /&gt;Season,&lt;BR /&gt;Style,&lt;BR /&gt;Color,&lt;BR /&gt;Size,&lt;BR /&gt;InvoiceQuantity,&lt;BR /&gt;ETPMRP,&lt;BR /&gt;RealisedSale,&lt;BR /&gt;TAXAmount,&lt;BR /&gt;TAXRate,&lt;BR /&gt;NETSale,&lt;BR /&gt;SalesPerson&lt;BR /&gt;FROM&lt;BR /&gt;[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;now i have done table chart in which i want to do sum(realisedsale) on the basis of ncodes&lt;/P&gt;&lt;P&gt;the result of sum(realisedsale) is 10000&lt;/P&gt;&lt;P&gt;but when i verify sum(realisedsale) in my sql table its showing 5000&lt;/P&gt;&lt;P&gt;so qlikview is showing exactly double data.&lt;/P&gt;&lt;P&gt;also double data is in every column of qlikview like sum(invoicequantity) , etc&lt;/P&gt;&lt;P&gt;please any help.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622069#M734547</guid>
      <dc:creator>riishabhz</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622185#M734548</link>
      <description>I would hazard a guess that the &amp;gt; condition is not working in the sql&lt;BR /&gt;check below statement . shouldnt the table name be max1?&lt;BR /&gt;let date2=Date(peek('SalesDate',0,'max'));&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2019 14:42:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622185#M734548</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-09-10T14:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622216#M734549</link>
      <description>Sir sql is working fine, its just double of sql value in my qlikview.&lt;BR /&gt;Any solutions sir&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:38:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622216#M734549</guid>
      <dc:creator>riishabhz</dc:creator>
      <dc:date>2019-09-10T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622217#M734550</link>
      <description>&lt;P&gt;you didnt read my reply correctly. the sql call within qlik is not working IMO&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622217#M734550</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-09-10T15:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622220#M734551</link>
      <description>Sir i correct it on my qlik but still same problem, should i have to make&lt;BR /&gt;new qvd for incremental from beginning ?&lt;BR /&gt;Or should i do sum(realisedsales)/2 in order to get results but that wont&lt;BR /&gt;be a correct solution i guess&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:53:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622220#M734551</guid>
      <dc:creator>riishabhz</dc:creator>
      <dc:date>2019-09-10T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622228#M734552</link>
      <description>&lt;P&gt;YOUR PEEK has an error, I think the date you are getting is either null or zero.&lt;/P&gt;&lt;P&gt;You have the third parameter in PEEK as 'max' and it should be 'max1'&lt;/P&gt;&lt;P&gt;I also think you have to initialize your qvd again and I would recommend adding a condition to exclude records that are retrieved by the SQL Check out the pseudo-code example below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MaxDate:
Load Max(RecordDate) as MaxDate
From [myqvd.qvd](qvd);

Let vMaxDate = Date(peek('MaxDate',0,'MaxDate'));

MyData:
Load
   RecordID,...;
SQL
Select * from Table Where RecordDate &amp;gt; '$(vMaxDate)';

Concatenate(MyData)
Load * from [myqvd.qvd](qvd)
//This where clause will prevent duplication
Where not exists(RecordID);

Store MyData into [myqvd.qvd](qvd);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 16:08:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622228#M734552</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2019-09-10T16:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622230#M734553</link>
      <description>Hi sir,&lt;BR /&gt;Ok sir but i have one doubt , if i write again last line of store qvd will&lt;BR /&gt;that not duplicate records?&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2019 16:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622230#M734553</guid>
      <dc:creator>riishabhz</dc:creator>
      <dc:date>2019-09-10T16:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622296#M734554</link>
      <description>&lt;P&gt;Storing a qvd will automatically overwrite the file.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 19:08:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1622296#M734554</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2019-09-10T19:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: sum result is showing double then sql result.</title>
      <link>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1627032#M734555</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Rishabh, did Chris' posts help you get what you needed in your project?&amp;nbsp; If so, please do not forget to circle back and give them credit for the help by using the Accept as Solution button on any posts that did help with the final solution.&amp;nbsp; If you did something else in the end, please consider posting what you did and then mark that as the solution.&amp;nbsp; If you are still working upon things, leave an update letting everyone know where things stand.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Brett&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:56:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-result-is-showing-double-then-sql-result/m-p/1627032#M734555</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-09-23T15:56:15Z</dc:date>
    </item>
  </channel>
</rss>

