<?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: Any better way to split a huge table into differente qvds in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009397#M83485</link>
    <description>&lt;P&gt;Hi Vegar!&lt;/P&gt;
&lt;P&gt;thanks for the answer!&lt;/P&gt;
&lt;P&gt;that would be the straightest way, but beware CDRS is about hundred millions lines, so every time you would search vDay against those millions lines.&lt;/P&gt;
&lt;P&gt;CDR_PENDING is there to decrease pending registers everytime you loop vDay (store and load qvds is very fast).&lt;/P&gt;
&lt;P&gt;With the amount of data this solution is much more efficient.&lt;/P&gt;
&lt;P&gt;My question is if theres any way to split a table based in a field without using loop.&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 26 Nov 2022 19:40:00 GMT</pubDate>
    <dc:creator>Fernando_Sanchez</dc:creator>
    <dc:date>2022-11-26T19:40:00Z</dc:date>
    <item>
      <title>Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009394#M83483</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;
&lt;P&gt;I am sure this topic has been discussed tons of time but can´t find a proper answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Imagine you have table with Millions of registers (for example CDRs calls) and you want to split it into different qvds each of if for a certaing day.&lt;/P&gt;
&lt;P&gt;Right now, what I am doing is a simple loop and store, something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FOR vDay=&amp;nbsp; $(vDayMin) to $(vDayMax)&lt;/P&gt;
&lt;P&gt;//Load original file&lt;BR /&gt;NoConcatenate&lt;BR /&gt;CDRS:&lt;BR /&gt;load *&lt;BR /&gt;from ..\work\CDRS.qvd (qvd)&lt;/P&gt;
&lt;P&gt;//Load files for vDay&lt;BR /&gt;NoConcatenate&lt;BR /&gt;CDRS_DATE:&lt;BR /&gt;load *&lt;BR /&gt;Resident CDRS&lt;BR /&gt;where day = $(vDay)&lt;/P&gt;
&lt;P&gt;//Store day file&lt;BR /&gt;store CDRS_DATE into ..\output\$(vDay)_CDRS.qvd (qvd)&lt;/P&gt;
&lt;P&gt;drop table CDRS_DATE;&lt;/P&gt;
&lt;P&gt;//Decrease original file without already stored registers&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;CDRS_PENDING:&lt;BR /&gt;load *&lt;BR /&gt;Resident CDRS&lt;BR /&gt;where day &amp;gt; $(vDay)&lt;/P&gt;
&lt;P&gt;drop table CDRS;&lt;/P&gt;
&lt;P&gt;store CDRS_PENDING into ..\work\CDRS.qvd (qvd);&lt;/P&gt;
&lt;P&gt;drop table CDRS_PENDING;&lt;/P&gt;
&lt;P&gt;next;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this code, everything works fine, but it taked too long. CDRS original file might be over 100 million registers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anyway to do it better? some way to iterate vDay within CDRS table only once and "create" on memory CDRS_DAY tables and afterwards make a loop and store all of them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 16:44:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009394#M83483</guid>
      <dc:creator>Fernando_Sanchez</dc:creator>
      <dc:date>2022-11-26T16:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009396#M83484</link>
      <description>&lt;P&gt;You are reading from and storing to file more than neccessary in your solution. What about keeping your initial load throughout the whole process? Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;//Load original file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CDRS:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;load *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;from ..\work\CDRS.qvd (qvd);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;for each vDay in fieldvaluelist('Day')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; CDRS_DATE:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; NoConcatenate load *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Resident CDRS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; where day = '$(vDay)';&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; //Store day file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; store CDRS_DATE into ..\output\$(vDay)_CDRS.qvd (qvd);&lt;BR /&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp; drop table CDRS_DATE;&lt;BR /&gt;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;next vDate&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;drop table CDRS;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 19:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009396#M83484</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2022-11-26T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009397#M83485</link>
      <description>&lt;P&gt;Hi Vegar!&lt;/P&gt;
&lt;P&gt;thanks for the answer!&lt;/P&gt;
&lt;P&gt;that would be the straightest way, but beware CDRS is about hundred millions lines, so every time you would search vDay against those millions lines.&lt;/P&gt;
&lt;P&gt;CDR_PENDING is there to decrease pending registers everytime you loop vDay (store and load qvds is very fast).&lt;/P&gt;
&lt;P&gt;With the amount of data this solution is much more efficient.&lt;/P&gt;
&lt;P&gt;My question is if theres any way to split a table based in a field without using loop.&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 19:40:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009397#M83485</guid>
      <dc:creator>Fernando_Sanchez</dc:creator>
      <dc:date>2022-11-26T19:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009401#M83486</link>
      <description>&lt;P&gt;I think you would need to loop in some way, but you should try to ensure an optimized load of your qvd file in order to save time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have trouble holding/handling the amount of data in my previous suggestion then you might consider to never load all the values at once. Consider this suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FOR vDay= $(vDayMin) to $(vDayMax)&lt;BR /&gt;&amp;nbsp; DayScope:&lt;BR /&gt;&amp;nbsp; LOAD&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; '$(vDay)' as&amp;nbsp;Day&lt;BR /&gt;&amp;nbsp; ];&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; //Optimized loag of single day data from qvd file&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; CDRS_DATE:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; load *&lt;BR /&gt;&amp;nbsp; from ..\work\CDRS.qvd (qvd)&lt;BR /&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp; where &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exists(Day) //Exists does not break optimized load&lt;BR /&gt;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; Drop table DayScope;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; //Store day file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; store CDRS_DATE into ..\output\$(vDay)_CDRS.qvd (qvd);&lt;BR /&gt;&amp;nbsp; drop table CDRS_DATE;&lt;BR /&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;next vDate&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 22:47:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009401#M83486</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2022-11-26T22:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009709#M83507</link>
      <description>&lt;P&gt;Thanks Vegar,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;unfortunatly the solution needs to loop and check within the table everytime we iterate a day.&lt;/P&gt;
&lt;P&gt;My question is if there is any possible way to do it without looping &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 12:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009709#M83507</guid>
      <dc:creator>Fernando_Sanchez</dc:creator>
      <dc:date>2022-11-28T12:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009840#M83514</link>
      <description>&lt;P&gt;I don't think that this could be done without a loop - at least not if you start with such qvd. Maybe this split might be better done in beforehand? And if this isn't very practically a split on a weekly/monthly level could reduce the afterwards efforts.&lt;/P&gt;
&lt;P&gt;Compared with your origin method and using a classical where-clause should the where exists() suggestion from&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp;perform much better because now the loads would be optimized. Especially if you there only perform the daily split and not the decrease of the&amp;nbsp;&lt;SPAN&gt;CDRS_PENDING because this could be done after the loop because a exists-filter-field could be created twice - one time for the daily split which is dropped again in each iteration and the second time each day is concatenated in the field and after the loop is a where &lt;STRONG&gt;not&lt;/STRONG&gt; exists() performed (the second field needs of course another fieldname which is then appropriate renamed before the reducing-load.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Further you may speed up this task by doing the split- and reducing-loads on a resident table and not loading from a qvd. AFAIK think the most people that an optimized qvd-load is faster as an optimized resident-load but I'm not so sure that's really true especially not if the storage or the network is rather slow and a bigger bottleneck as RAM or CPU. IMO it's a try worth.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 15:07:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009840#M83514</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-28T15:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Any better way to split a huge table into differente qvds</title>
      <link>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009877#M83521</link>
      <description>&lt;P&gt;Great answer Marcus.&lt;/P&gt;
&lt;P&gt;Definititly would give a try to&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt; proposed solution.&lt;/P&gt;
&lt;P&gt;The preload of a qvd was made up for the example. In the real world I have to upload a bunch of csv files.&lt;/P&gt;
&lt;P&gt;I would give a run in paralel what is better and consumes less time.&lt;/P&gt;
&lt;P&gt;Thanks a lof for your kindness.&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 16:27:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Any-better-way-to-split-a-huge-table-into-differente-qvds/m-p/2009877#M83521</guid>
      <dc:creator>Fernando_Sanchez</dc:creator>
      <dc:date>2022-11-28T16:27:08Z</dc:date>
    </item>
  </channel>
</rss>

