<?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: Invoice amount in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604229#M1101787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know what is going on in the code..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Apr 2014 11:51:00 GMT</pubDate>
    <dc:creator>surajap123</dc:creator>
    <dc:date>2014-04-22T11:51:00Z</dc:date>
    <item>
      <title>Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604227#M1101785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Could you please let me know what the functionality of below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InvoiceTemp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvoiceLineId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InvoiceType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((Amount / Discount) / (INTERVAL(DATE(InvoiceToDate) - (InvoiceFromDate),'K')+1))) AS InvoiceAmount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(InvoiceFromDate + IterNo() -1 ) AS InvoiceDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Invoice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHILE IterNo() &amp;lt;=&amp;nbsp; Date(InvoiceToDate) - InvoiceFromDate +1; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoice:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt; intInvoiceLineId,&lt;/P&gt;&lt;P&gt; InvoiceType,&lt;/P&gt;&lt;P&gt; InvoiceDate,&lt;/P&gt;&lt;P&gt; SUM(InvoiceAmount) AS InvoiceAmount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT&amp;nbsp; InvoiceTemp&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; InvoiceDate,InvoiceType, InvoiceLineId;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it necessary to create the above aggregated table(ie Invoice) to get the InvoiceAmount for a particulary point of time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 11:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604227#M1101785</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-04-22T11:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604228#M1101786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it is necessary and grouping is also necessary by each dimension other wise error occurs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 11:49:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604228#M1101786</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-22T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604229#M1101787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know what is going on in the code..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 11:51:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604229#M1101787</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-04-22T11:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604230#M1101788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the above code in table &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceTemp there is a loop between &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceToDate and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceFromDate &lt;/SPAN&gt; until the loop satisfy the condition loop running on and calculate the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount.&lt;/SPAN&gt;&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;And in the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Invoice&lt;/SPAN&gt; table calculate the SUM of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount&lt;/SPAN&gt; and aggregate the&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; with the dimension&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;intInvoiceLineId,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;InvoiceType,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;InvoiceDate&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Yes it is necessary but you can calculate in the front end also and aggregate the Sum &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt; in the front end also by like this &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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Aggr(SUM(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount),&lt;/SPAN&gt;intInvoiceLineId,InvoiceType,InvoiceDate&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you done this in the Invoice table no need to do aggr in front end just you have to use &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;SUM(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 11:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604230#M1101788</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-22T11:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604231#M1101789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;Thanks for the explanation !!&lt;/P&gt;&lt;P&gt;Due to the loop, the InvoiceTemp table is creating millions of rows. The actual invoice table (the source for InvoiceTemp) contain very few rows. &lt;/P&gt;&lt;P&gt;This is the table in dashboard which takes long time to load data.&lt;/P&gt;&lt;P&gt;Is there any alternate to calculate the InvoiceAmount?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 12:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604231#M1101789</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-04-22T12:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604232#M1101790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As i understand you can do one thing in &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceTemp&lt;/SPAN&gt; only calculate &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;(Amount / Discount)&lt;/SPAN&gt; and take a field &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount&lt;/SPAN&gt; not divide it with the Interval value and calculate intervals in separate table and in front end divide with this value with dateinterval value. I believe it decreases the calculation time of the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceAmount&lt;/SPAN&gt; because if you have so many dates then the calculation is going on and takes more time to calculate the table. And another way is use Interval in the charts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 12:31:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604232#M1101790</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-22T12:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Invoice amount</title>
      <link>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604233#M1101791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have difficulty working on what you suggested.&lt;/P&gt;&lt;P&gt;I have build a sample app.&amp;nbsp; could you please calculate intervals in separate table and provide a sample front end as you suggested. This will really help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invoice-amount/m-p/604233#M1101791</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-04-22T13:00:12Z</dc:date>
    </item>
  </channel>
</rss>

