<?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 Range based on a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189459#M52341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steve. It has worked wonders and performance is much better now. However the problem is - model created has a lot of synthetic keys.&lt;/P&gt;&lt;P&gt;I check the help of this function IntervalMatch and in the example, it does not mentions anything about the systhetic keys etc.&lt;/P&gt;&lt;P&gt;I would see if I can do anything about it now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Sep 2010 09:40:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-08T09:40:40Z</dc:date>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189454#M52336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a table (Instruments) having columns: InstID, LGD, Currency, Amount and another table LGDRange that stores the range information for LGD.&lt;/P&gt;&lt;P&gt;LGDRange:&lt;/P&gt;&lt;P&gt;Min Max Range&lt;/P&gt;&lt;P&gt;0 10 Range10&lt;/P&gt;&lt;P&gt;11 21 Range21&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;I am suppose to generate a graph for chart defined in the table. Now what I did is: (1) Load LGD Range table (2) Load Instrument table as InstTemp (3) Loop through Range table for number of rows in it and find out which columns fit which range. Script is as below:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;InstTemp:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD&lt;BR /&gt; InstID,&lt;BR /&gt; LGD,&lt;BR /&gt; UCurrency,&lt;BR /&gt; NetCommitment&lt;BR /&gt;FROM&lt;BR /&gt;&lt;F&gt;&lt;BR /&gt;(qvd);&lt;/F&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;For vCounter = 0 To (FieldValueCount('LGDRange')-1)&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;Let vLGDMin = peek('LGDMin', vCounter, 'RangeLGD');&lt;BR /&gt; Let vLGDMax = peek('LGDMax', vCounter, 'RangeLGD');&lt;BR /&gt; Let vRangeLGD = peek('LGDRange',vCounter, 'RangeLGD');&lt;BR /&gt; Inst:&lt;BR /&gt; NOCONCATENATE&lt;BR /&gt; Load&lt;BR /&gt; *,&lt;BR /&gt; peek('LGDRange',vCounter, 'RangeLGD') as RangeLGD&lt;BR /&gt; RESIDENT InstTemp&lt;BR /&gt; WHERE&lt;BR /&gt; LossGivenDefaultPercent &amp;gt;= vLGDMin And&lt;BR /&gt; LossGivenDefaultPercent &amp;lt; vLGDMax;&lt;BR /&gt;Next vCounter;&lt;/P&gt;&lt;P&gt;drop table InstTemp;&lt;/P&gt;&lt;P&gt;I tried debug and everything works fine till it exits the loop. During the debug it shows that each loop fetched how many rows and the no. shown is as expected.&lt;/P&gt;&lt;P&gt;As soon as exits the loop, the QV stops responding. I have to kill QV. Just wondering what is happening here and why is it not responding. If the comment out the loop, everything works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 09:35:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189454#M52336</guid>
      <dc:creator />
      <dc:date>2010-09-06T09:35:18Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189455#M52337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just small correction, the variables are used as $(vLGDMin) and so on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 09:40:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189455#M52337</guid>
      <dc:creator />
      <dc:date>2010-09-06T09:40:17Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189456#M52338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;At a first glance, you are using a NOCONCATENATE for each table loaded inside the loop. Depending on your amount of records, it may cause QlikView to keep calculating a very large number of synth keys, since the fields for each table inside the loop are exactly the same, and since noconcatenate does not prevent to create those synthetic keys which, in your case, I'm guessing are not wanted.&lt;/P&gt;&lt;P&gt;As this process is done in memory, QlikView doesn't show any external sign apart from, I'd say, an unusual memory and cpu usage, which can cause your application to break.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 09:59:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189456#M52338</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-09-06T09:59:09Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189457#M52339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Minguel.&lt;/P&gt;&lt;P&gt;Not sure how, but the issue of QV getting stuck was solved. I just logged off and logged in agan to QV.&lt;/P&gt;&lt;P&gt;And yes, NOCONCATENATE was causing 20 tables getting created and a lot synthetic keys. This is working fine now.&lt;/P&gt;&lt;P&gt;There is one more thing which is causing perf issue however. I am just thinking how can I get around it. I have around 10M rows and 20 ranges. Now all these 10M rows have to be passed through the loop 20 times. This causing perf problems.&lt;/P&gt;&lt;P&gt;What I think I can do in the loop:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Load&lt;BR /&gt; InstID,&lt;BR /&gt; LGD,&lt;BR /&gt; UCurrency,&lt;BR /&gt; NetCommitment&lt;BR /&gt;FROM&lt;BR /&gt;&lt;F&gt;&lt;BR /&gt;(qvd);&lt;/F&gt;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;For vCounter = 0 To (FieldValueCount('LGDRange')-1)&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Let vLGDMin = peek('LGDMin', vCounter, 'RangeLGD');&lt;BR /&gt; Let vLGDMax = peek('LGDMax', vCounter, 'RangeLGD');&lt;BR /&gt; Let vRangeLGD = peek('LGDRange',vCounter, 'RangeLGD');&lt;BR /&gt;&lt;BR /&gt; Inst:&lt;BR /&gt; Load&lt;BR /&gt; InstID as InstIDForRange,&lt;BR /&gt; '$(vRangeLGD) as LGDRange&lt;BR /&gt; RESIDENT InstTemp&lt;BR /&gt; WHERE&lt;BR /&gt; LossGivenDefaultPercent &amp;gt;= $(vLGDMin) And&lt;BR /&gt; LossGivenDefaultPercent &amp;lt; $(vLGDMax) And&lt;BR /&gt; InstID not exists (InstIDForRange, InstID);&lt;BR /&gt;Next vCounter;&lt;/P&gt;&lt;P&gt;Not sure if it would work as the field InstIDForRange would work during the first loop. I am going to give it a try.&lt;/P&gt;&lt;P&gt;Any suggestion if there is a better way to avoid 10M * 10 loops for performance?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 06:10:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189457#M52339</guid>
      <dc:creator />
      <dc:date>2010-09-08T06:10:08Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189458#M52340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think IntervalMatch prefix could help you a lot here.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 07:32:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189458#M52340</guid>
      <dc:creator />
      <dc:date>2010-09-08T07:32:04Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189459#M52341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steve. It has worked wonders and performance is much better now. However the problem is - model created has a lot of synthetic keys.&lt;/P&gt;&lt;P&gt;I check the help of this function IntervalMatch and in the example, it does not mentions anything about the systhetic keys etc.&lt;/P&gt;&lt;P&gt;I would see if I can do anything about it now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 09:40:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189459#M52341</guid>
      <dc:creator />
      <dc:date>2010-09-08T09:40:40Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189460#M52342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By the way I have found one more work around. while building QVD files, I can write the inner join and can add Range cols there itself.&lt;/P&gt;&lt;P&gt;I am going to try and see if I can overcome this synth key issue for IntervalMatch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 10:16:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189460#M52342</guid>
      <dc:creator />
      <dc:date>2010-09-08T10:16:09Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189461#M52343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Check some posts regarding intervalmatch where complete examples are developed (&lt;A href="http://community.qlik.com/forums/p/16046/62339.aspx" title="Intervalmatch - value outside of interval"&gt;this one&lt;/A&gt; or &lt;A href="http://community.qlik.com/forums/t/33525.aspx" title="Load resident table between 2 ranges"&gt;this other one&lt;/A&gt; for instance). Since a new table is created as a result of that intervalmatch, some synth keys will appear and you will need to drop some tables or fields once your tables are linked properly.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 11:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189461#M52343</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-09-08T11:05:18Z</dc:date>
    </item>
    <item>
      <title>Range based on a table</title>
      <link>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189462#M52344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Miguel. It is working now. I had to add some joins and some drop field statements. Copying the final code here for ref.&lt;/P&gt;&lt;P&gt;LGDRange:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;Load&lt;BR /&gt; RangeName as LGDRangeName,&lt;BR /&gt; MinRange as LGDMin,&lt;BR /&gt; MaxRange as LGDMax,&lt;BR /&gt; Description as LGDRangeDesc,&lt;BR /&gt; MinRange &amp;amp; '_' &amp;amp; MaxRange as LGDJoinKey&lt;BR /&gt;RESIDENT&lt;BR /&gt; Range&lt;BR /&gt;WHERE AttribName = 'LGDRange';&lt;/P&gt;&lt;P&gt;Instrument_Res:&lt;BR /&gt; FIRST 10000&lt;BR /&gt; LOAD RFInstrumentID,&lt;BR /&gt; //convert from decimal to %&lt;BR /&gt; LGD * 100 as LGD,&lt;BR /&gt; FROM&lt;BR /&gt; F:\Final QVDs\InstrumentResults_201003.qvd (qvd);&lt;/P&gt;&lt;P&gt;//**** Step through Instrument table for each LGD range and locate the LGd range&lt;BR /&gt;InstLGD1:&lt;BR /&gt;LEFT JOIN (Instrument_Res) IntervalMatch ( LGD ) LOAD (LGDMin + 0.00001) as LGDMin, (LGDMax + 0.0001) as LGDMax RESIDENT LGDRange;&lt;/P&gt;&lt;P&gt;InstLGD2:&lt;BR /&gt;INNER JOIN (Instrument_Res) LOAD RFInstrumentID, (LGDMin &amp;amp; '_' &amp;amp; LGDMax) as LGDJoinKey RESIDENT Instrument_Res;&lt;BR /&gt;Drop fields LGDMin, LGDMax FROM Instrument_Res;&lt;/P&gt;&lt;P&gt;InstLGD3:&lt;BR /&gt;LEFT JOIN (Instrument_Res) LOAD LGDJoinKey, LGDRangeName RESIDENT LGDRange;&lt;BR /&gt;Drop fields LGDJoinKey;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 04:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-based-on-a-table/m-p/189462#M52344</guid>
      <dc:creator />
      <dc:date>2010-09-09T04:42:15Z</dc:date>
    </item>
  </channel>
</rss>

