<?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: How to join two tables without impact on load time and performance in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729032#M55591</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/894"&gt;@Saravanan_Desingh&lt;/a&gt;&amp;nbsp; &amp;amp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18132"&gt;@lorenzoconforti&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me in this pls?&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jul 2020 13:38:03 GMT</pubDate>
    <dc:creator>harsha</dc:creator>
    <dc:date>2020-07-19T13:38:03Z</dc:date>
    <item>
      <title>How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1728826#M55567</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;With the below scripts, I have 4 tables RAWDATA,&amp;nbsp;Rule_1, Rule_2 &amp;amp; Rule_3 . But I want only RAWDATA with Flags created in different tables in it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below script in place where RAWDATA table has all the dimensions along with Rule_4_Flag and Rule_5_Flag created from other tables(Rule_34 &amp;amp; Rule_5)...but I want to include Rule_1_Flag, Rule_2_Flag &amp;amp;&amp;nbsp;Rule_3_Flag&amp;nbsp; into RAW Data as dimensions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RAWDATA:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD &amp;nbsp;*&lt;/P&gt;&lt;P&gt;FROM [lib:// Checks/ DATA_2019.QVD] (qvd);&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////Rule-1_/////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule_1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;if((VALUE)&amp;gt;100,'Yes','No') as Rule-1_Flag&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;where match (DataID,'36950','42915');&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////Rule-2_////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule_2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;if((VALUE)&amp;lt;0,'Yes','No') as Rule-2_Flag&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;where match (DataID,'36950');&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////Rule-3/////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule_3:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;//if(Frac(VALUE)&amp;gt;0,'WithDecimal','WithoutDecimal') as Decimal_Flag&lt;/P&gt;&lt;P&gt;if(SubStringCount(VALUE,'.')&amp;gt;=1,'WithDecimal','WithoutDecimal') as Decimal_Flag&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;where match (DataID,'60685');&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////Rule-4//////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule_4:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], VALUE As Value1&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;Where DataID=60634843285;&lt;/P&gt;&lt;P&gt;Left Join(Rule_4)&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], VALUE As Value2&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;Where DataID=60634843286;&lt;/P&gt;&lt;P&gt;Left Join(RAWDATA)&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], If(Value1&amp;lt;Value2, 'Yes','No') As Rule_4_Flag&lt;/P&gt;&lt;P&gt;Resident Rule_4;&lt;/P&gt;&lt;P&gt;Drop Table Rule_4;&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////Rule-5//////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule_5:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], VALUE As Value1&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;Where DataID=60634843285;&lt;/P&gt;&lt;P&gt;Left Join(Rule_5)&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], VALUE As Value2&lt;/P&gt;&lt;P&gt;Resident RAWDATA&lt;/P&gt;&lt;P&gt;Where DataID=60634843321;&lt;/P&gt;&lt;P&gt;Left Join(RAWDATA)&lt;/P&gt;&lt;P&gt;LOAD CompanyID, [Time Series Year], If(Value1&amp;lt;Value2, 'Yes','No') As Rule_5_Flag&lt;/P&gt;&lt;P&gt;Resident Rule_5;&lt;/P&gt;&lt;P&gt;Drop Table Rule_5;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1728826#M55567</guid>
      <dc:creator>harsha</dc:creator>
      <dc:date>2024-11-16T18:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729032#M55591</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/894"&gt;@Saravanan_Desingh&lt;/a&gt;&amp;nbsp; &amp;amp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18132"&gt;@lorenzoconforti&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me in this pls?&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jul 2020 13:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729032#M55591</guid>
      <dc:creator>harsha</dc:creator>
      <dc:date>2020-07-19T13:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729054#M55600</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The only way you will make it so that data load is performant is to create the flags when you are creating the QVD, rather than after loading from it. The first load here is going to be an Optimised QVD Load, which will be super quick. All subsequent loads, from the RESIDENT tables will not be optimised.&lt;/P&gt;&lt;P&gt;Take a read of my blog post on optimised loads, as this goes into a fair bit of detail of what you can an cannot do with an optimised load:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.quickintelligence.co.uk/qlikview-optimised-qvd-loads/" target="_blank"&gt;https://www.quickintelligence.co.uk/qlikview-optimised-qvd-loads/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are also going to have serious issues with how the code is written at present with synthetic keys. Even with the first two loads, if the QVD has columns A, B and C you are loading from these, and then creating a second table with columns A, B, C and &lt;SPAN&gt;Rule-1_Flag. Qlik will need to create a key which combines A, B and C in a synthetic key, this will be disastrous&amp;nbsp;for performance, and if you have a high number of rows or columns it will crash things.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It will not be optimised, but you will get a much better result doing the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD
*,
if(DataID = 36950 or DataID = 42915, if(VALUE)&amp;gt;100,'Yes','No'), null()) as Rule-1_Flag,
if(DataID = 36950, if((VALUE)&amp;lt;0,'Yes','No'), null()) as Rule-2_Flag,
if(DataID = 60685, if(SubStringCount(VALUE,'.')&amp;gt;=1,'WithDecimal','WithoutDecimal'), null()) as Decimal_Flag
FROM [lib:// Checks/ DATA_2019.QVD] (qvd);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure what is going on with the joins in the subsequent checks, but you need to ensure that you don't create any synthetic keys in when you are creating those rules either. If it the checks can be done when you first load from the QVD (assuming you can't do it when you create the QVD) then that will be better.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jul 2020 16:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729054#M55600</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-07-19T16:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729056#M55602</link>
      <description>Thanks for the detailed reply Steve... they are awesome tips ... however, how would I add multiple DataIDs ? Like flag 1&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Jul 2020 17:49:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729056#M55602</guid>
      <dc:creator>harsha</dc:creator>
      <dc:date>2020-07-19T17:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729073#M55603</link>
      <description>&lt;P&gt;Unless I am misunderstanding something, the code above is dealing with two DataIDs in this line:&lt;/P&gt;&lt;PRE&gt;if(DataID = 36950 or DataID = 42915, &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've removed the single quotes, as all your IDs seem to be numbers and comparing numbers is inherently quicker than comparing strings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have missed something please explain.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jul 2020 23:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729073#M55603</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-07-19T23:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729103#M55605</link>
      <description>&lt;P&gt;that's right... I missed this point to include.. my bad.&lt;/P&gt;&lt;P&gt;for flag 2, i want to apply for certain DataIDs..&lt;/P&gt;&lt;P&gt;(DataID,'36950','42999','60471','60477','60475','60475','60473');&lt;/P&gt;&lt;P&gt;How can I handle if the more number of DataIDs to include ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 07:05:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729103#M55605</guid>
      <dc:creator>harsha</dc:creator>
      <dc:date>2020-07-20T07:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables without impact on load time and performance</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729105#M55606</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can still use the match statement as you had in your original code. I just used&amp;nbsp; = as there were only two options in the example you gave. For three or more options match makes sense.&lt;/P&gt;&lt;P&gt;I would try it with and without quote marks, it may perform better without.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 07:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-join-two-tables-without-impact-on-load-time-and/m-p/1729105#M55606</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-07-20T07:22:53Z</dc:date>
    </item>
  </channel>
</rss>

