<?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: Speed up splitting large QVD by month? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105994#M7198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may need to add floor() to Matus' solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vDays = floor(MonthEnd(MakeDate($(vYear), $(vMonth),1))) - MonthStart(MakeDate($(vYear), $(vMonth),1)) + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Oct 2018 05:34:02 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2018-10-16T05:34:02Z</dc:date>
    <item>
      <title>Speed up splitting large QVD by month?</title>
      <link>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105992#M7196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a QVD of 500 million rows which is unwieldy.&amp;nbsp; Therefore I split it by month based on a timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;TempTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;FROM [lib://Qlik Data Files/LargeFile.qvd] (qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For vYear = 2010 to YEAR (today()-1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For vMonth = 1 to 12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vMonth2 = Num (vMonth , '00');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vDate = $(vYear) &amp;amp; '-' &amp;amp; $(vMonth2) &amp;amp;'-01';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vShortDate = $(vYear) &amp;amp; '-' &amp;amp; $(vMonth2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SplitTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESIDENT TempTable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE timestamp &amp;gt;= MonthStart(DATE#('$(vDate)' , 'YYYY-MM-DD')) and &lt;SPAN style="font-size: 13.3333px;"&gt;timestamp&lt;/SPAN&gt; &amp;lt;= MonthEnd(DATE#('$(vDate)' , 'YYYY-MM-DD'));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Store * from &lt;STRONG style="font-size: 13.3333px;"&gt;SplitTable &lt;/STRONG&gt;into 'lib://Qlik Data Files/Month-$(vShortDate).qvd';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop Table &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;SplitTable&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Next vMonth&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Next vYear;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trouble is that even though it's a RESIDENT table, it is still quite slow (it runs through the same table multiple times, each time for the next month). Is there anyway to speed it up by either;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Ignoring the dates already processed (in essence dropping the rows) so the table will shrink in size by a month with every pass, &lt;EM&gt;or&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;If I load the table (or store the QVD) pre-sorted on timestamp, will this increase the search speed?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Unfortunately I can't assume that 'old' timestamps won't be inserted into the data so I must process the whole file every time - I can't just do the current/past month.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2018 16:24:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105992#M7196</guid>
      <dc:creator>quriouss</dc:creator>
      <dc:date>2018-10-15T16:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up splitting large QVD by month?</title>
      <link>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105993#M7197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can limit the date directly in the load.&lt;/P&gt;&lt;P&gt;Be careful that to keep the qvd load optimized you can only use "where exists". That means you will have to load a temp table with all dates with the same field name.&lt;/P&gt;&lt;P&gt;If you use a real timestamp you will need to create a new field with date - timestamp has too much unique values to be used in where exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code - never tested it for speed but I believe it should be faster.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;For vYear = 2010 to YEAR (today()-1)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt; For vMonth = 1 to 12&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; vDays = MonthEnd(MakeDate($(vYear), $(vMonth),1)) - MonthStart(MakeDate($(vYear), $(vMonth),1)) + 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; tmpDates:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; MakeDate($(vYear), $(vMonth), RecNo())&amp;nbsp; As timestamp&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; AutoGenerate (vDays);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; TempTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; FROM [lib://Qlik Data Files/LargeFile.qvd] (qvd)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; Where Exists(timestamp);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; //Store table&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; //Drop both tables&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt; Next vMonth;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Next vYear;&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2018 22:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105993#M7197</guid>
      <dc:creator>mkelemen</dc:creator>
      <dc:date>2018-10-15T22:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up splitting large QVD by month?</title>
      <link>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105994#M7198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may need to add floor() to Matus' solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vDays = floor(MonthEnd(MakeDate($(vYear), $(vMonth),1))) - MonthStart(MakeDate($(vYear), $(vMonth),1)) + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 05:34:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105994#M7198</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-10-16T05:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up splitting large QVD by month?</title>
      <link>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105995#M7199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest that you replaced your timestamp within the origin qvd with a date and a time like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(floor(timestamp)) as date,&lt;/P&gt;&lt;P&gt;time(frac(timestamp)) as time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to reduce the number of distinct fieldvalues - for the background, see: &lt;A href="https://community.qlik.com/qlik-blogpost/3632"&gt;The Importance Of Being Distinct&lt;/A&gt; and it will reduce the size of the qvd quite significantly and all following loadings should be a lot faster. Also it makes it easier to create such exists() temp-table like suggest from &lt;A href="https://community.qlik.com/qlik-users/98005"&gt;mkelemen&lt;/A&gt; and I'm not sure that the date-approach there will be really work with your timestamps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 06:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Speed-up-splitting-large-QVD-by-month/m-p/105995#M7199</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-10-16T06:54:50Z</dc:date>
    </item>
  </channel>
</rss>

