<?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: Load data from database in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340276#M125620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd recommend do not use Order By clause in the load SQL statement (I'm not clear why do you need it?). Please use temporary table for initial load instead. Order By might be very costly operation on the back end side.&lt;/P&gt;&lt;P&gt;In addition, you might need to setup index in your DB on post_type field to speed up the process. If you cannot do this, just load everything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;LOAD *;&lt;BR /&gt;&lt;SPAN class="jive-sql-keyword"&gt;SQL&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword"&gt;SELECT&lt;/SPAN&gt; * &lt;SPAN class="jive-sql-keyword"&gt;from&lt;/SPAN&gt; part;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;NewTable:&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt; NoConcatenate Load * Resident Temp&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;Where &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;post_type=6 &lt;/P&gt;&lt;P&gt;&lt;SPAN class="jive-sql-keyword"&gt;order&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword"&gt;by&lt;/SPAN&gt; post_type;&lt;/P&gt;&lt;P&gt;Drop table Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2012 19:16:10 GMT</pubDate>
    <dc:creator>bgerchikov</dc:creator>
    <dc:date>2012-08-06T19:16:10Z</dc:date>
    <item>
      <title>Load data from database</title>
      <link>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340274#M125618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like to load from a big table only the records with a special value (e.q. =Post_type=6). I use the load en select statement withe the where clausule and order by like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *from part&lt;/P&gt;&lt;P&gt;where post_type=6 order by post_type;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This works, but QV read all the rekords and it takes a lot of time. Ik would like qv to stop after read and load the records which i want. &lt;/P&gt;&lt;P&gt;How do i get QV to stop the load after loading the wanted record and not to read the whole table ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 14:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340274#M125618</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T14:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Load data from database</title>
      <link>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340275#M125619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13442637871217597" jivemacro_uid="_13442637871217597"&gt;&lt;P&gt;LOAD *;&lt;/P&gt;&lt;P&gt;SQL SELECT * from part Where post_type=6 order by post_type;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should work. Since the qlikview will only execute SQL statement which will process with the condition. You confirm this from the log file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran Rokkam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 14:36:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340275#M125619</guid>
      <dc:creator />
      <dc:date>2012-08-06T14:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Load data from database</title>
      <link>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340276#M125620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd recommend do not use Order By clause in the load SQL statement (I'm not clear why do you need it?). Please use temporary table for initial load instead. Order By might be very costly operation on the back end side.&lt;/P&gt;&lt;P&gt;In addition, you might need to setup index in your DB on post_type field to speed up the process. If you cannot do this, just load everything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;LOAD *;&lt;BR /&gt;&lt;SPAN class="jive-sql-keyword"&gt;SQL&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword"&gt;SELECT&lt;/SPAN&gt; * &lt;SPAN class="jive-sql-keyword"&gt;from&lt;/SPAN&gt; part;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;NewTable:&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt; NoConcatenate Load * Resident Temp&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;Where &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;post_type=6 &lt;/P&gt;&lt;P&gt;&lt;SPAN class="jive-sql-keyword"&gt;order&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword"&gt;by&lt;/SPAN&gt; post_type;&lt;/P&gt;&lt;P&gt;Drop table Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 19:16:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340276#M125620</guid>
      <dc:creator>bgerchikov</dc:creator>
      <dc:date>2012-08-06T19:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Load data from database</title>
      <link>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340277#M125621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Kiran said, QV will only process the records that meet the where condition, but the "order by' clause could be hurting performance if the source table is large. Use Kiran's script, without the order by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;LOAD *;&lt;BR /&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;SQL&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;SELECT&lt;/SPAN&gt; * &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;from&lt;/SPAN&gt; part &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;Where&lt;/SPAN&gt; post_type=6&lt;/CODE&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also do you need all the fields in the table? If not, then it would be better to name the fields in the SQL SELECT statement, rather than using SELECT *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 20:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-data-from-database/m-p/340277#M125621</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-06T20:05:23Z</dc:date>
    </item>
  </channel>
</rss>

