<?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: Loading a balance table missing daily records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300276#M588668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more important thing I forgot to mention,&lt;/P&gt;&lt;P&gt;you need to set "Full accumulation" for the sum(transaction) expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="4395" alt="fullaccumulation.JPG" class="jive-image" src="https://community.qlik.com/legacyfs/online/4395_fullaccumulation.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2011 06:41:38 GMT</pubDate>
    <dc:creator>gandalfgray</dc:creator>
    <dc:date>2011-05-17T06:41:38Z</dc:date>
    <item>
      <title>Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300272#M588664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to upload a transactional table with the following simple structure&amp;nbsp; (Date&amp;nbsp; , Balance) .... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case there is no balance movement during a day, then no record do exist, for exmaple &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On 1/4/2011 the balance is 10,000 US$ , therefore will be a record on the table as (1/4/2011 - 10,000$)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On 2/4/2011, a transaction was done by 300. then there will be a record on the table as (2/4/2011 - 9700$) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On 28/4/2011, a transactionw as done of 2000$, then a record will be on the table as (28/4/2011&amp;nbsp; - 7700$) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so by end of this example, the table will have only 3 records, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I build an application that show the balance of each day even for the days not found in the table &lt;/P&gt;&lt;P&gt;also, which commands to use if I like to see the differences bewteen each day and its previous day with reporting as a movement chart &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 May 2011 11:04:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300272#M588664</guid>
      <dc:creator />
      <dc:date>2011-05-15T11:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300273#M588665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;One approach is to create everything on the script. This will reduce the complexity on the interface. &lt;/P&gt;&lt;P&gt;I create a small example for this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I run throught the table to get min and max dates, then I created all the dates between min and max. &lt;/P&gt;&lt;P&gt;After this I read the table again filling the gaps with the previous known value. At the same time, I created another field with the differences between the current value and the last known one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check app attached. &lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;tBalance:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date, Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/04/2011, 1000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/04/2011, 9700&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28/04/2011, 2000&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load min(Date) as minDate resident tBalance;&lt;/P&gt;&lt;P&gt;varMinDate = peek('minDate');&lt;/P&gt;&lt;P&gt;load max(Date) as maxDate resident tBalance;&lt;/P&gt;&lt;P&gt;varMaxDate = peek('maxDate');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refDate:&lt;/P&gt;&lt;P&gt;load date($(varMinDate)+rowno()-1) as Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Autogenerate(num($(varMaxDate)-$(varMinDate))+1) ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join(refDate)&lt;/P&gt;&lt;P&gt;Load Date, Balance resident tBalance&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tBalance; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//NoConcatenate&lt;/P&gt;&lt;P&gt;load Date, if(IsNull(Balance),peek('NewBalance'), Balance) as NewBalance,&lt;/P&gt;&lt;P&gt; if(IsNull(Balance), peek('NewBalance'), Balance)-peek('NewBalance') as var&lt;/P&gt;&lt;P&gt;resident refDate&lt;/P&gt;&lt;P&gt;order by Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table refDate;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 May 2011 14:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300273#M588665</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-05-15T14:35:10Z</dc:date>
    </item>
    <item>
      <title>Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300274#M588666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Many thanks Erich for the quick response &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the number of accounts I have is 1 million account, and maintaining 5 years data which will lead to have a table of 1 million * 5 * 365 .... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use your script within my code, but as I am fresh in QlickView, I was not able to manage it ... any help &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my existing code is as the following to load the balance table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load Id, &lt;/P&gt;&lt;P&gt;account_no, &lt;/P&gt;&lt;P&gt;code, &lt;/P&gt;&lt;P&gt;currency, &lt;/P&gt;&lt;P&gt;balance_date,&lt;/P&gt;&lt;P&gt;balance;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 16pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10pt; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt; &lt;STRONG style="color: blue; font-size: 10pt; font-family: 'Courier New';"&gt;SELECT&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: #004d4d; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 10pt; font-family: 'Courier New';"&gt;FROM&lt;/STRONG&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #004d4d; font-size: 10pt;"&gt;bi.dbo."acounts_balances;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2011 13:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300274#M588666</guid>
      <dc:creator />
      <dc:date>2011-05-16T13:06:58Z</dc:date>
    </item>
    <item>
      <title>Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300275#M588667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your goal is just to show a chart like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="continuosgraph.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4381_continuosgraph.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;you don't need to generate records for every day,&lt;/P&gt;&lt;P&gt;instead you just use a &lt;STRONG&gt;line chart&lt;/STRONG&gt; with the following special settings:&lt;/P&gt;&lt;P&gt;set the "Display Option" to "Plateau, leading"&lt;/P&gt;&lt;P&gt;&lt;IMG alt="lineplateu.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4385_lineplateu.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and set the dimension axis to "Continuos":&lt;/P&gt;&lt;P&gt;&lt;IMG alt="continuos.JPG" class="jive-image" src="https://community.qlik.com/legacyfs/online/4386_continuos.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My load script for this example just looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transactions:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date, Transaction&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/4/2011, 10000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/4/2011, -300&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/4/2011, 900&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28/4/2011, -2000&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2011 13:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300275#M588667</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2011-05-16T13:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300276#M588668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more important thing I forgot to mention,&lt;/P&gt;&lt;P&gt;you need to set "Full accumulation" for the sum(transaction) expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="4395" alt="fullaccumulation.JPG" class="jive-image" src="https://community.qlik.com/legacyfs/online/4395_fullaccumulation.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 06:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300276#M588668</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2011-05-17T06:41:38Z</dc:date>
    </item>
    <item>
      <title>Loading a balance table missing daily records</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300277#M588669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;Thanks Erish for the help... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The objective is to calculate the account holder behavior based on the difference and how long he keeps his holdings &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;with your script I tried to apply it but it didn't work as I am confused of how using the SQL load and the resident fields, so I am attaching here my script hope this will clear for me how to load the table again with the leftjoin statement /////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;tBalance:&lt;BR /&gt;Load&lt;BR /&gt;account_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp; account_Key ,&lt;BR /&gt;currency&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp; Position_Currency ,&lt;BR /&gt;position_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp; Position_Date ,&lt;BR /&gt;Bal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp; Position_Bal;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM bi.dbo."accounts_table";&lt;/P&gt;&lt;P style="text-align: left;"&gt;load min(Position_Date) as minDate resident tBalance; &lt;BR /&gt;varMinDate = peek('minDate'); &lt;BR /&gt;load max(Position_Date) as maxDate resident tBalance; &lt;BR /&gt;varMaxDate = peek('maxDate');&lt;/P&gt;&lt;P style="text-align: left;"&gt;refDate:&lt;BR /&gt;load date($(varMinDate)+rowno()-1) as Date&lt;BR /&gt;Autogenerate(num($(varMaxDate)-$(varMinDate))+1) ;&lt;BR /&gt;left join(refDate)&lt;/P&gt;&lt;P style="text-align: left;"&gt;//&amp;nbsp; Load Date, Position_Bal resident tBalance (not able to understand how this will work with the SQL select) &lt;BR /&gt;;&lt;BR /&gt;;&lt;/P&gt;&lt;P style="text-align: left;"&gt;NoConcatenate&lt;BR /&gt;load Date, if(IsNull(Position_HoldingQty),peek('NewBalance'), Position_HoldingQty) as NewBalance,&amp;nbsp; if(IsNull(Position_HoldingQty), peek('NewBalance'), Position_HoldingQty)-peek('NewBalance') as var resident refDate order by Date;&lt;/P&gt;&lt;P style="text-align: left;"&gt;drop table refDate;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 13:11:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-balance-table-missing-daily-records/m-p/300277#M588669</guid>
      <dc:creator />
      <dc:date>2011-05-17T13:11:00Z</dc:date>
    </item>
  </channel>
</rss>

