<?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: Intervalmatch on several fields with AND operation? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632830#M678336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darek, trying out your idea I realize that your earlier question was spot on. I can get more than one category for one ACCODE, it is all ACCODES together that is disjoint and may not overlap. If it were'nt for the intervals I would create a composite key. Trying out your idea above I got stuck on the first column in the interval table where all starts is 0000 and all ends is 8999 which would give me all categories on all ACCODE01s. Any ideas on how to solve this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 May 2014 21:41:09 GMT</pubDate>
    <dc:creator>Amphan</dc:creator>
    <dc:date>2014-05-14T21:41:09Z</dc:date>
    <item>
      <title>Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632824#M678323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to figure out how to categorize a transaction depending on whether several different fields in the transaction are within a certain range. In my current task I have seven fields, let's call them ACCODE01 - 07 and seven corresponding ranges, ACCODE01_START, ACCODE01_END, ACCODE02_START, ACCODE02_END etc. If each ACCODEXX field is within its corresponding range, ie. ACCODE01 is in ACCODE01_START to ACCODE01_END &lt;STRONG&gt;AND&lt;/STRONG&gt; ACCODE02 is in ACCODE02_START to ACCODE02_END &lt;STRONG&gt;AND&lt;/STRONG&gt; etc. then I want to mark the transaction with a Category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I have these tables (random data, might not add up), what I want is to add CATEGORY from INTERVAL: to FACT: where ACCODEXX is in THE ACCODEXX_START to ACCODEXX_END range. If there is no match, no category should be assigned. &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14000673308249597" jivemacro_uid="_14000673308249597"&gt;
&lt;P&gt;FACT:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE01, ACCODE02, ACCODE03, ACCODE04, ACCODE05, ACCODE06, ACCODE07, VERID, AMOUNT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10000, 40261, 12340, 12300, 5478, 2541, 2587, 123456789, $100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20000, 86210, 43210, 45600, 9866, 2365, 1236, 987546, $1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30000, 86400, 58740, 78900, 2222, 5895, 9854, 124578, $200&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40000, 86111, 98560, 98700, 9874, 4578, 7854, 326598, $1100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50000, 46435, 12450, 65400, 2587, 1245, 2569, 785612, $800&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 60000, 45698, 45780, 32100, 3698, 6542, 3254, 324578, $500&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 70000, 32145, 65540, 74100, 1478, 1111, 1256, 1245782, $600&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80000, 78954, 32120, 36900, 2589, 2224, 9854, 69854225, $1900&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INTERVAL:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CATEGORY, ACCODE01_START, ACCODE01_END, ACCODE02_START, ACCODE02_END, ACCODE03_START, ACCODE03_END, ACCODE04_START, ACCODE04_END, ACCODE05_START, ACCODE05_END, ACCODE06_START, ACCODE06_END, ACCODE07_START, ACCODE07_END&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APPLES, 0000, 8999, 40260, 40270, 00000, 96999, 0000, 9999, 0000, 9999, 0000, 9999, 0000, 0000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORANGES, 0000, 8999, 65410, 65510, 00000, 96999, 0000, 9999, 0000, 9999, 0000, 9999, 0000, 0000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BANANAS, 0000, 8999, 86110, 86710, 03560, 03560, 0000, 9999, 0000, 9999, 0000, 9999, 0000, 9999&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHERRYS, 0000, 8999, 86310, 86330, 03560, 03560, 0000, 9999, 0000, 9999, 0000, 9999, 0000, 9999&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIMES, 0000, 8999, 86400, 86400, 03560, 03560, 0000, 9999, 0000, 9999, 0000, 9999, 0000, 9999&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEMONS, 0000, 8999, 46430, 46440, 00000, 96999, 1000, 1099, 0000, 9999, 0000, 9999, 0000, 0000&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd really appreciate any help to move forward on this task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 11:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632824#M678323</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-14T11:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632825#M678326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ola,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are your ranges &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;disjoint&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;or&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;may&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;overlap (if they overlaping, you may get more than one category for one ACCODE)?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;what if you will get 1 category by ACCODE01 and another by ACCODE02?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;do you need after this transformation 1 category for each row?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Darek&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 12:50:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632825#M678326</guid>
      <dc:creator />
      <dc:date>2014-05-14T12:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632826#M678328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darek, the idea is that they should be disjoint, every matching transaction can only get one unique category or if no match then no category. If I didn't need to check for intervals I would just create a key of the ACCODE fields but I am at a loss as the fields should be matched to intervals. So I need to check for ACCODE01 in interval01 AND ACCODE02 in interval02 etc. for all seven fields/intervals and if all is true then set the category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 13:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632826#M678328</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-14T13:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632827#M678330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do loop with 7 iterations&lt;/P&gt;&lt;P&gt;in each iteration:&lt;/P&gt;&lt;P&gt;intervalmatch 1 column and into FACT table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after last one loop you should have FACT table with added 7 columns (cat1-cat7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then load resident FACT table (columns you need) again with new name, using if(rangeminstring (col1......col7)=rangemaxstring (col1......col7) and rangemissingcount (col1....col7)=0, col1) as result_category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table FACT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 13:34:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632827#M678330</guid>
      <dc:creator />
      <dc:date>2014-05-14T13:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632828#M678332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here you have all about methods to do interval matching:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4310"&gt;IntervalMatch and Slowly Changing Dimensions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 14:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632828#M678332</guid>
      <dc:creator />
      <dc:date>2014-05-14T14:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632829#M678334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it maybe some start point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 14:54:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632829#M678334</guid>
      <dc:creator />
      <dc:date>2014-05-14T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632830#M678336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darek, trying out your idea I realize that your earlier question was spot on. I can get more than one category for one ACCODE, it is all ACCODES together that is disjoint and may not overlap. If it were'nt for the intervals I would create a composite key. Trying out your idea above I got stuck on the first column in the interval table where all starts is 0000 and all ends is 8999 which would give me all categories on all ACCODE01s. Any ideas on how to solve this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 21:41:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632830#M678336</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-14T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632831#M678337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darek, I will have a look at it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 21:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632831#M678337</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-14T21:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632832#M678338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, lets look on it again. I can imagine, that for some fact i can get for&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;By accode01 banana or Apple&lt;/P&gt;&lt;P&gt;By accode02 banana or lenin&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;By accode07 banana or Orange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, there is the question what category wins for this fact row.&lt;/P&gt;&lt;P&gt;What are the criteria? Is it possible, that more than one category for this&lt;/P&gt;&lt;P&gt;one fact row will have the same rank?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14-05-2014 23:41 użytkownik "Ola Paulsson" &amp;lt;qcwebmaster@qlik.com&amp;gt;&lt;/P&gt;&lt;P&gt;napisał:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;      Qlik Community &amp;lt;http://community.qlik.com/&amp;gt;   Intervalmatch on&lt;/P&gt;&lt;P&gt;several fields with AND operation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from Ola Paulsson&amp;lt;http://community.qlik.com/people/OlaPaulsson?et=watches.email.thread&amp;gt;in&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scripting&lt;/STRONG&gt; - View the full discussion&amp;lt;http://community.qlik.com/message/528689?et=watches.email.thread#528689&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 22:11:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632832#M678338</guid>
      <dc:creator />
      <dc:date>2014-05-14T22:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632833#M678339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, one row will always be unique, ie. accode01&amp;amp;accode02&amp;amp;accode03&amp;amp;accode04&amp;amp;accode05&amp;amp;accode06&amp;amp;accode07 will only match one category in interval table. No overlap for the composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe one approach would be to create a table with all possible combinations of intervals and categories and then check that against a composite key in the fact table? But i worry about the size of such a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will work on this tomorrow but will appreciate any input you have! Many thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 22:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632833#M678339</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-14T22:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632834#M678340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, cartesian will make very big table. How many rows do you have on the&lt;/P&gt;&lt;P&gt;beginning im fact and interval tables?&lt;/P&gt;&lt;P&gt;15-05-2014 00:28 użytkownik "Ola Paulsson" &amp;lt;qcwebmaster@qlik.com&amp;gt;&lt;/P&gt;&lt;P&gt;napisał:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 06:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632834#M678340</guid>
      <dc:creator />
      <dc:date>2014-05-15T06:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632835#M678341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fact table will have around 8-10 million rows but the interval table will only have around 100 rows (100 categories) or less. Each accode field holds an integer with 5 positions so with full interval ranges the cartesian product from that table would have a max of 100000 raised to 7 rows, am I right? In reality it will be lower as the interval ranges will be more narrow but still, it could be a huge table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 06:41:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632835#M678341</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-15T06:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632836#M678342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many categories for one fact you expect separately by each key?&lt;/P&gt;&lt;P&gt;15-05-2014 08:42 użytkownik "Ola Paulsson" &amp;lt;qcwebmaster@qlik.com&amp;gt;&lt;/P&gt;&lt;P&gt;napisał:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 07:09:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632836#M678342</guid>
      <dc:creator />
      <dc:date>2014-05-15T07:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632837#M678343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One, if I understand you correctly. Every transaction (row) in the fact table can only have one category. The category is determined by whether each of the accode fields are within range in its corresponding interval. These combinations of intervals in the intervals table are disjoint and not overlapping (unique) as a composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 07:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632837#M678343</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-15T07:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632838#M678344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If so, my example should work as you expect. It founds one category by each&lt;/P&gt;&lt;P&gt;key and on the end checks If all 7 categories are the same. If YES, fact&lt;/P&gt;&lt;P&gt;has this category. If no, fact has no category. Is it the logice you need?&lt;/P&gt;&lt;P&gt;15-05-2014 09:22 użytkownik "Ola Paulsson" &amp;lt;qcwebmaster@qlik.com&amp;gt;&lt;/P&gt;&lt;P&gt;napisał:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;      Qlik Community &amp;lt;http://community.qlik.com/&amp;gt;   Intervalmatch on&lt;/P&gt;&lt;P&gt;several fields with AND operation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from Ola Paulsson&amp;lt;http://community.qlik.com/people/OlaPaulsson?et=watches.email.thread&amp;gt;in&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scripting&lt;/STRONG&gt; - View the full discussion&amp;lt;http://community.qlik.com/message/528866?et=watches.email.thread#528866&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 07:30:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632838#M678344</guid>
      <dc:creator />
      <dc:date>2014-05-15T07:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632839#M678345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will need to take a closer look at the example code you provided, it is a bit above my skill level so I need some time to understand it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt;. In the meantime I think I found a solution in the document you linked to but I choose method 3 on page 6 that says "Don’t use this method unless you have very small tables". I will see if I can learn more during the weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 11:01:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632839#M678345</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-15T11:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632840#M678346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ola,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;script works and:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_f: load 0 as VERID AutoGenerate(0); &lt;/P&gt;&lt;P&gt;//prepares empty table (to have it for 1'st join)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to 7&lt;/P&gt;&lt;P&gt;//we have 7 keys, so we need to deal with each of them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//we join into existing tmp_f table (this is why i created it over loop)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join(tmp_f) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load ACCODE0$&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/info.png" /&gt; as ACCODE, VERID&amp;nbsp; Resident FACT;&lt;/P&gt;&lt;P&gt;//ACCODE0$(i) gives column ACCODE01,2,3... depending on iter number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_i:&lt;/P&gt;&lt;P&gt;load ACCODE0$(i)_START as start, ACCODE0$(i)_END as end, CATEGORY as cat$(i), Autonumber(Num(ACCODE0$(i)_START) &amp;amp; '|' &amp;amp; Num(ACCODE0$(i)_END)) as IntervalID&amp;nbsp; Resident inter; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//into tmp_i table i load i'th range boudary (columns ACCODE0$(i)_START and ACCODE0$(i)_END), but i create //from them key (interval_id) for each row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bridge:&lt;/P&gt;&lt;P&gt;IntervalMatch ( ACCODE ) load distinct start,end Resident tmp_i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//create table by intervalmatch (ACCODE is key from tmp_f table used for this iteration , start and end are range //from tmp_i (temporary interval) for this iteration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//and we have to clear what our interval produces, because we would like to have only tmp_f table when we start //next iteration in our loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (tmp_f)&lt;/P&gt;&lt;P&gt;Load ACCODE, Autonumber(Num(start) &amp;amp; '|' &amp;amp; Num(end)) as IntervalID&lt;/P&gt;&lt;P&gt;Resident bridge;&lt;/P&gt;&lt;P&gt;Drop Table bridge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (tmp_f) LOAD cat$(i),&amp;nbsp; IntervalID resident tmp_i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tmp_i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop fields ACCODE,IntervalID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//after last one iteration we should have tmp_f table where we have 7 category columns (cat1,cat2,....cat7)&lt;/P&gt;&lt;P&gt;//you may comment instructions under and look on it in your application.&lt;/P&gt;&lt;P&gt;//from this table we will check if all 7 cat have the same value.&lt;/P&gt;&lt;P&gt;//if max=min then all existing values must be the same. &lt;/P&gt;&lt;P&gt;//so, we need only check if the 7 cat have values (no nulls) and we may decide to give category for fact. Knowing //that all cat fieldsghave the same value i take first, so, my result is cat1 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load VERID,&amp;nbsp; if(RangeMaxString(cat1,cat2,cat3,cat4,cat5,cat6,cat7)=RangeMinString(cat1,cat2,cat3,cat4,cat5,cat6,cat7) and RangetextCount(cat1,cat2,cat3,cat4,cat5,cat6,cat7)=7, cat1) as category Resident tmp_f Where Exists(VERID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tmp_f;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 11:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632840#M678346</guid>
      <dc:creator />
      <dc:date>2014-05-15T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632841#M678347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are too kind! I will look at this tonight. In the meantime, I got this to work from page 6, method 3 in the document you linked to. I will see if I can use another method which doesn't create a cartesian product but this works on my testcase. But i would like to create a general method to categorize a transaction which isn't so memory intensive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_BridgeTable:&lt;/P&gt;&lt;P&gt;load distinct &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _CompositeKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE01, ACCODE02, ACCODE03, ACCODE04, ACCODE05, ACCODE06, ACCODE07&lt;/P&gt;&lt;P&gt;resident FACT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (tmp_BridgeTable)&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _IntervalID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CATEGORY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE01_START, ACCODE01_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE02_START, ACCODE02_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE03_START, ACCODE03_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE04_START, ACCODE04_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE05_START, ACCODE05_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE06_START, ACCODE06_END, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCODE07_START, ACCODE07_END&lt;/P&gt;&lt;P&gt;resident INTERVAL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BridgeTable:&lt;/P&gt;&lt;P&gt;load distinct _CompositeKey, _IntervalID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resident tmp_BridgeTable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where (ACCODE01_START &amp;lt;= ACCODE01 and ACCODE01 &amp;lt;= ACCODE01_END) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE02_START &amp;lt;= ACCODE02 and ACCODE02 &amp;lt;= ACCODE02_END)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE03_START &amp;lt;= ACCODE03 and ACCODE03 &amp;lt;= ACCODE03_END) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE04_START &amp;lt;= ACCODE04 and ACCODE04 &amp;lt;= ACCODE04_END)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE05_START &amp;lt;= ACCODE05 and ACCODE05 &amp;lt;= ACCODE05_END) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE06_START &amp;lt;= ACCODE06 and ACCODE06 &amp;lt;= ACCODE06_END)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (ACCODE07_START &amp;lt;= ACCODE07 and ACCODE07 &amp;lt;= ACCODE07_END)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;drop table tmp_BridgeTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632841#M678347</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-15T14:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632842#M678348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ola,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i looked for join from your script:&lt;/P&gt;&lt;P&gt;Join (tmp_BridgeTable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are commone keys in joindet tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:02:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632842#M678348</guid>
      <dc:creator />
      <dc:date>2014-05-16T09:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalmatch on several fields with AND operation?</title>
      <link>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632843#M678349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When loading FACT: I add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ACCODE01&amp;amp;'|'&amp;amp;ACCODE02&amp;amp;'|'&amp;amp;ACCODE03&amp;amp;'|'&amp;amp;ACCODE04&amp;amp;'|'&amp;amp;ACCODE05&amp;amp;'|'&amp;amp;ACCODE06&amp;amp;'|'&amp;amp;ACCODE07 as _CompositeKey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and when I load Interval I add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RecNo() as _IntervalID,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which I use in the BridgeTable to link them. Solves the problem and doesn't seem to be too bad on performance, but then again there isn't that much data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Ola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Intervalmatch-on-several-fields-with-AND-operation/m-p/632843#M678349</guid>
      <dc:creator>Amphan</dc:creator>
      <dc:date>2014-05-16T09:17:45Z</dc:date>
    </item>
  </channel>
</rss>

