<?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 Performance issue with query from Data Warehouse in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Performance-issue-with-query-from-Data-Warehouse/m-p/1275951#M26413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with millions of rows for the first time and wonder what is the most efficient approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the same dataset, a colleague created a script utilizing preceding load straight into the front-end qvw with the following idea:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In the FROM-part of the SQL&lt;OL&gt;&lt;LI&gt;SQL Select the appropriate fields from two tables (both having millions of records)&lt;/LI&gt;&lt;LI&gt;Inner Join the tables based on two keys (YearMonth and ID)&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;In the SELECT -part of the SQL&lt;OL&gt;&lt;LI&gt;Calculate difference of 2 fields; Delta-field&lt;/LI&gt;&lt;LI&gt;TRUNC (round) many fields&lt;/LI&gt;&lt;LI&gt;Rename fields&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Preceding load -qlik script&lt;OL&gt;&lt;LI&gt;Create a concatenated key from the YearMonth and ID&lt;/LI&gt;&lt;LI&gt;Use an if clause to create a Status-field based on the value of Delta-field&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried to use an approach with incremental load using separate Qlik-tables for each DW-table: this took a lot longer than my colleague's script.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create temp tables with normal preceding load for the two tables&lt;OL&gt;&lt;LI&gt;Where-clause to limit SQL Select to new data (MonthYear as great or greater than current month)&lt;/LI&gt;&lt;LI&gt;Create a concatenated key from the YearMonth and ID in the qlik script -part of the preceding load&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Store these temp tables into qvd:s&lt;/LI&gt;&lt;LI&gt;Load temp tables containing new data from qvds and concatenate them with the entire dataset (another load with a wider Where-clause) being loaded from two qvd:s&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;*** at this point I have two tables and qvds with the whole dataset ***&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 4. Create an inner join between the two tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 5. Store this table in a qvd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 6. Load this table from qvd and&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;&amp;nbsp;&amp;nbsp; *calculate Delta-field based on the difference of 2 fields&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; *use an if clause to create a Status-field based on the values of Delta-field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if this is ambiguously written, what I am basically asking is this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is it recommended/faster to&lt;OL&gt;&lt;LI&gt;Do joins already in the SQL part?&lt;/LI&gt;&lt;LI&gt;Calculate differences between fields already in the SQL part?&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;What would be overall be an efficient strategy in this situation&lt;OL&gt;&lt;LI&gt;Two tables with millions of rows, joined via a concatenated key&lt;/LI&gt;&lt;LI&gt;A difference needs to be calculated on a detailed level (YearMonth and ID) with two fields, each from a table&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2017 07:25:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-13T07:25:16Z</dc:date>
    <item>
      <title>Performance issue with query from Data Warehouse</title>
      <link>https://community.qlik.com/t5/App-Development/Performance-issue-with-query-from-Data-Warehouse/m-p/1275951#M26413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with millions of rows for the first time and wonder what is the most efficient approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the same dataset, a colleague created a script utilizing preceding load straight into the front-end qvw with the following idea:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In the FROM-part of the SQL&lt;OL&gt;&lt;LI&gt;SQL Select the appropriate fields from two tables (both having millions of records)&lt;/LI&gt;&lt;LI&gt;Inner Join the tables based on two keys (YearMonth and ID)&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;In the SELECT -part of the SQL&lt;OL&gt;&lt;LI&gt;Calculate difference of 2 fields; Delta-field&lt;/LI&gt;&lt;LI&gt;TRUNC (round) many fields&lt;/LI&gt;&lt;LI&gt;Rename fields&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Preceding load -qlik script&lt;OL&gt;&lt;LI&gt;Create a concatenated key from the YearMonth and ID&lt;/LI&gt;&lt;LI&gt;Use an if clause to create a Status-field based on the value of Delta-field&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried to use an approach with incremental load using separate Qlik-tables for each DW-table: this took a lot longer than my colleague's script.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create temp tables with normal preceding load for the two tables&lt;OL&gt;&lt;LI&gt;Where-clause to limit SQL Select to new data (MonthYear as great or greater than current month)&lt;/LI&gt;&lt;LI&gt;Create a concatenated key from the YearMonth and ID in the qlik script -part of the preceding load&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Store these temp tables into qvd:s&lt;/LI&gt;&lt;LI&gt;Load temp tables containing new data from qvds and concatenate them with the entire dataset (another load with a wider Where-clause) being loaded from two qvd:s&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;*** at this point I have two tables and qvds with the whole dataset ***&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 4. Create an inner join between the two tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 5. Store this table in a qvd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 6. Load this table from qvd and&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;&amp;nbsp;&amp;nbsp; *calculate Delta-field based on the difference of 2 fields&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; *use an if clause to create a Status-field based on the values of Delta-field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if this is ambiguously written, what I am basically asking is this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is it recommended/faster to&lt;OL&gt;&lt;LI&gt;Do joins already in the SQL part?&lt;/LI&gt;&lt;LI&gt;Calculate differences between fields already in the SQL part?&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;What would be overall be an efficient strategy in this situation&lt;OL&gt;&lt;LI&gt;Two tables with millions of rows, joined via a concatenated key&lt;/LI&gt;&lt;LI&gt;A difference needs to be calculated on a detailed level (YearMonth and ID) with two fields, each from a table&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 07:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Performance-issue-with-query-from-Data-Warehouse/m-p/1275951#M26413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-13T07:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with query from Data Warehouse</title>
      <link>https://community.qlik.com/t5/App-Development/Performance-issue-with-query-from-Data-Warehouse/m-p/1275952#M26414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general an incremental load with qvd's should be faster than sql-loadings against a database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it will be depend on various things how much faster it could be and the efforts which are needed for it.&lt;/P&gt;&lt;P&gt;For example, is the database quite fast and the limiting factors are mainly the database-driver and/or the network it could be that the inner join + the few transformations (status + truncating) are faster performed as the same rawdata without any transforming are transferred to qlik. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you couldn't get this step faster with qlik but you could load this joined table with an incremental approach - and I think this is the essential point here - by an incremental loading you need not only load the rawdata incrementally you must also load the transformation-results incremental and by this building a multi-staging load-approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your case it might be a bit expensive to do this but if load-performance is a bottleneck or you could use thes qvd's in other cases it might be worth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 08:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Performance-issue-with-query-from-Data-Warehouse/m-p/1275952#M26414</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-03-13T08:08:51Z</dc:date>
    </item>
  </channel>
</rss>

