<?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: Exclude a list of relations in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448613#M698624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2 things:&lt;/P&gt;&lt;P&gt;1: I didn't know that where not exists() accepts more than 1 parameter (and therefore I thought that my relations table had to have the "relationsToExclude" column)... So this is something I learn (and will test asap). Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2: I don't understand why the comparison with match will work fine...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$(FinancialRelations) is one large string with commaseparated relationnumbers...&lt;/LI&gt;&lt;LI&gt;when this string contains the value 100 ( so relation 100 must be excluded) &lt;/LI&gt;&lt;LI&gt;and my relation table contains relation number 1 and 10... then I assume that &lt;STRONG style="color: #737373; background-color: #ffffff; font-family: Arial;"&gt;Where not Match( relationNumber, $(FinancialRelations));&lt;/STRONG&gt; also excludes 1 and 10... &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Or am I mistaking? &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2013 11:00:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-19T11:00:29Z</dc:date>
    <item>
      <title>Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448611#M698622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A scripting question:&lt;/P&gt;&lt;P&gt;In our loadscript we have some code like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET FinancialRelations&amp;nbsp; = '123,14413,2417,2342340,24444566,5555,8888,9999';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is that the (comma separated) relationnumbers listed in that variable are excluded in some loadstatements (like when loading the relations table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The current implementation is &lt;/P&gt;&lt;P&gt;where match(relationNumber,$(FinancialRelations&amp;nbsp; ))=0&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;I think this can be risky, for eg when relation 100 must be excluded and relation 1 and 10 exists...&amp;nbsp; I think that then relation 1 and 10 are excluded (and should not be).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the easiest way to exclude those relations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in SQL I would just write &lt;/P&gt;&lt;P&gt;select * FROM relations where relationNumber not in (select number from RelationsToExclude)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can load the RelationsToExclude in an inline table with this script &lt;/P&gt;&lt;P&gt;RelationsToExclude:&lt;/P&gt;&lt;P&gt;load Num(SubField('$(BoekhoudkundigeRelaties)',',')) as RelationsToExclude&lt;/P&gt;&lt;P&gt;AutoGenerate(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andd probably the easiest way is to use where not exists.... But I wonder if there is no easier way... Since when using not exists... I need the field &lt;STRONG&gt;relationsToExclude&lt;/STRONG&gt; also in my relationsTable which I do not need (and I need an additional resident load...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or am I just making things to complicated and is there an easier way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 09:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448611#M698622</guid>
      <dc:creator />
      <dc:date>2013-02-19T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448612#M698623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A comparison with Match() will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where not Match( relationNumber, $(FinancialRelations));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I would probably use a Where not Exists() instead - since you probably have the numbers to exclude in a table already. Hence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RelationsToExclude:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT RelationsToExclude FROM ... ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RelationsToInclude:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load * Where not Exists(RelationsToExclude, Relation);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT * FROM ... ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop Table RelationsToExclude;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 10:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448612#M698623</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-02-19T10:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448613#M698624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2 things:&lt;/P&gt;&lt;P&gt;1: I didn't know that where not exists() accepts more than 1 parameter (and therefore I thought that my relations table had to have the "relationsToExclude" column)... So this is something I learn (and will test asap). Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2: I don't understand why the comparison with match will work fine...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$(FinancialRelations) is one large string with commaseparated relationnumbers...&lt;/LI&gt;&lt;LI&gt;when this string contains the value 100 ( so relation 100 must be excluded) &lt;/LI&gt;&lt;LI&gt;and my relation table contains relation number 1 and 10... then I assume that &lt;STRONG style="color: #737373; background-color: #ffffff; font-family: Arial;"&gt;Where not Match( relationNumber, $(FinancialRelations));&lt;/STRONG&gt; also excludes 1 and 10... &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Or am I mistaking? &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 11:00:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448613#M698624</guid>
      <dc:creator />
      <dc:date>2013-02-19T11:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448614#M698625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will only exclude the listed values and no other. Try the following and you'll see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set FinancialRelations&amp;nbsp;&amp;nbsp; = 100, 10000 ;&lt;/P&gt;&lt;P&gt;Load * Where not Match( relationNumber, $(FinancialRelations));&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'1'&amp;amp;repeat('0',recno()-1) as relationNumber&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;autogenerate 10;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 11:38:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448614#M698625</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-02-19T11:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448615#M698626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no other answer possible than You're absolutely right!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer and support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apparently Qlikview doesn't treat the variable FinancialRelations as a string (...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even when I enclose the relations with singlequotes (like below), it still works like I want (it excludes the 100 and 10.000).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set FinancialRelations&amp;nbsp;&amp;nbsp; = '100, 10000';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good to know!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 11:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448615#M698626</guid>
      <dc:creator />
      <dc:date>2013-02-19T11:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a list of relations</title>
      <link>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448616#M698627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whether you have single quotes or not, doesn't matter. The variable FinancialRelations will in both cases have a value equal to a string: '100, 10000'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The magic is in the dollar-expansion. Right before execution of a statement, QlikView will exchange all $(variable) -constructions with the variable value. I.e. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load * Where not Match( relationNumber, $(FinancialRelations));&lt;/P&gt;&lt;P&gt;will be exchanged with &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load * Where not Match( relationNumber, 100, 10000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when this statement is executed, the field relationNumber will be compared with 100 and 10000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 12:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exclude-a-list-of-relations/m-p/448616#M698627</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-02-19T12:07:05Z</dc:date>
    </item>
  </channel>
</rss>

