<?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 Set analysis Vs intervalMatch in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218131#M71296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe you should see this. If this is fit in your case.&lt;/P&gt;&lt;P&gt;http://community.qlik.com/forums/p/23510/89770.aspx#89770&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Apr 2011 13:32:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-15T13:32:25Z</dc:date>
    <item>
      <title>Set analysis Vs intervalMatch</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218130#M71295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Let's say we have these datas :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;// Date Format is : YYYYMMDD&lt;BR /&gt;VALUES:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ID_PRODUCT, ID_DATE, AMOUNT1, AMOUNT2&lt;BR /&gt;501860, 20100117, 50, 1530&lt;BR /&gt;501860, 20100215, 65, 1750&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;//Rates where START_DATE is the starting date of the rate. So, the next DATDEB would be the end date...&lt;BR /&gt;//For example, in the first line, "20090101" is the "start date" of the rate "4", and "20091130" is the "end date" of this same rate...&lt;BR /&gt;RATE:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ID_PRODUCT, START_DATE, RATE&lt;BR /&gt;501860, 20090101, 4&lt;BR /&gt;501860, 20091130, 5&lt;BR /&gt;501860, 20091230, 5.1&lt;BR /&gt;501860, 20100115, 5.3&lt;BR /&gt;501860, 20100130, 6&lt;BR /&gt;501860, 20100217, 7&lt;BR /&gt;];&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I have this reloaded, both tables are joined with the field ID_PRODUCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that I want to have a graph table which has to look like that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID_PRODUCT, ID_DATE, AMOUNT1, RATE&lt;/P&gt;&lt;P&gt;501860 20100117 50 5.3&lt;/P&gt;&lt;P&gt;501860 20100215 65 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The hard part is the last column named (RATE).&lt;/P&gt;&lt;P&gt;I tried this with bad results :&lt;/P&gt;&lt;P&gt;sum( If( START_DATE = (max( if( START_DATE &amp;lt; ID_DATE, START_DATE) )), RATE))&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;START_DATE = {"=max( {&amp;lt;START_DATE={"&amp;lt;ID_DATE"]&amp;gt;} START_DATE)"}&amp;gt;} RATE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In english, what I want is the "RATE" of the last "START_DATE" which is before "ID_DATE"...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, don't tell me to do an "IntervalMatch" since I don't want to do that in the script : I have a 1 billion table to Match and it takes like 1 hour...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonrod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 12:29:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218130#M71295</guid>
      <dc:creator />
      <dc:date>2011-04-15T12:29:36Z</dc:date>
    </item>
    <item>
      <title>Set analysis Vs intervalMatch</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218131#M71296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe you should see this. If this is fit in your case.&lt;/P&gt;&lt;P&gt;http://community.qlik.com/forums/p/23510/89770.aspx#89770&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 13:32:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218131#M71296</guid>
      <dc:creator />
      <dc:date>2011-04-15T13:32:25Z</dc:date>
    </item>
    <item>
      <title>Set analysis Vs intervalMatch</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218132#M71297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jonrod,&lt;/P&gt;&lt;P&gt;Try the following expression, is that what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;FirstSortedValue(RATE, -IF(START_DATE &amp;lt; ID_DATE, START_DATE))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I didn't do an intervalmatch with such a volume of data unless strictly necessary.&lt;/P&gt;&lt;P&gt;Anyway, since the aggregation function has a conditional, it may take long to display the chart, so now that you know how does it perform doing an intervalmatch, I'd try the expression before.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 14:12:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218132#M71297</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-15T14:12:12Z</dc:date>
    </item>
    <item>
      <title>Set analysis Vs intervalMatch</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218133#M71298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FirstSortedValue() is the right approach, however it might not be such a good idea to use it in run-time on a 1 Bil. rows table - unless your chart is ALWAYS running over a smaller subset of the data, defined by narrow selections.&lt;/P&gt;&lt;P&gt;You may want to use a similar approach in your load script. By the way, if you need this kind of advanced analysis performed on a 1 bil. rows, a 1 hour addition to the load time is not such a bad penalty - consider your alternatives... It's better to add 1 hour to the data load, than to cause a 40 seconds lag in the run-time, in front of a user...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 15:22:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218133#M71298</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-04-15T15:22:34Z</dc:date>
    </item>
    <item>
      <title>Set analysis Vs intervalMatch</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218134#M71299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh Yes!! That's It!!&lt;/P&gt;&lt;P&gt;Thank you very much for your replies.&lt;/P&gt;&lt;P&gt;I've been working on it for hours... Need to learn a lot of you folks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FirstSortedValue() worked for me and it don't "lag" because my graph is filtered on a few lines (less than 100 000...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonrod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 16:37:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Vs-intervalMatch/m-p/218134#M71299</guid>
      <dc:creator />
      <dc:date>2011-04-15T16:37:58Z</dc:date>
    </item>
  </channel>
</rss>

