<?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 Selecting all but one values via Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108422#M16977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's suppose I need to select all my countries but France (no macros, just a regular selection). I can get it just by typing this in the search bar: -FRANCE. Goal achieved!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, let's try to do it via macro. I know I could do this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Country").Select "FRANCE"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country")&lt;/SPAN&gt;.SelectedExcluded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this method has a problem: I may already have other selections (in other fields) and the new selection Country = France could be not matching them (for example, let's imagine I had selected City = Rome). If that happens, QlikView will remove as many selections as it needs to show data for France (normal QlikView behavior, as we know). I would lose the City = Rome filter, only because I wanted to exclude France. Locking all those previous selections wouldn't be a good choice here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I could try to work around this just by trying the minus sign approach. That is, selecting "-FRANCE" instead of having to take the two steps previously explained. But when I try to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country").&lt;/SPAN&gt;Select "-FRANCE"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;It just doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Please, is there any way to achieve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2018 08:55:29 GMT</pubDate>
    <dc:creator>ramonarcusa36</dc:creator>
    <dc:date>2018-07-04T08:55:29Z</dc:date>
    <item>
      <title>Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108422#M16977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's suppose I need to select all my countries but France (no macros, just a regular selection). I can get it just by typing this in the search bar: -FRANCE. Goal achieved!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, let's try to do it via macro. I know I could do this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Country").Select "FRANCE"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country")&lt;/SPAN&gt;.SelectedExcluded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this method has a problem: I may already have other selections (in other fields) and the new selection Country = France could be not matching them (for example, let's imagine I had selected City = Rome). If that happens, QlikView will remove as many selections as it needs to show data for France (normal QlikView behavior, as we know). I would lose the City = Rome filter, only because I wanted to exclude France. Locking all those previous selections wouldn't be a good choice here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I could try to work around this just by trying the minus sign approach. That is, selecting "-FRANCE" instead of having to take the two steps previously explained. But when I try to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country").&lt;/SPAN&gt;Select "-FRANCE"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;It just doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Please, is there any way to achieve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 08:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108422#M16977</guid>
      <dc:creator>ramonarcusa36</dc:creator>
      <dc:date>2018-07-04T08:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108423#M16978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this,&lt;/P&gt;&lt;P&gt;you can use the &lt;EM&gt;toggleselect&lt;/EM&gt; function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic;"&gt;sub NameSub&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set FIELDNAME = activedocument.fields("&lt;/EM&gt;FIELDNAME")&lt;/P&gt;&lt;P&gt;FIELDNAME.select "20200" ' clears all in &lt;EM&gt;FIELDNAME&lt;/EM&gt; and selects 20200&lt;/P&gt;&lt;P&gt;FIELDNAME.toggleselect "50300" ' selects 50300&lt;/P&gt;&lt;P&gt;FIELDNAME.toggleselect "60200" ' selects 60200&lt;/P&gt;&lt;P style="font-style: italic;"&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 13:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108423#M16978</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-07-04T13:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108424#M16979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if it's possible - if it it will be probably a matter of quotes-syntax like doubling them or something similar stuff. Unfortunately it's not visible how the macro called this selection respectively how it will be interpreted from the field. This means it would be an ugly trial and error ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an alternatively you could use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country").&lt;/SPAN&gt;Select "=match(Country, 'FRANCE')=0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 14:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108424#M16979</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-07-04T14:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108425#M16980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding to the excellent posting from Stefan here: &lt;A href="https://community.qlik.com/docs/DOC-15671"&gt;Compound Search - demystified&lt;/A&gt; you could also use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ActiveDocument.Fields("Country").&lt;/SPAN&gt;Select "(* ^ *FRANCE*)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 14:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108425#M16980</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-07-04T14:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108426#M16981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's perfect. That helped me a lot. I solved my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2018 12:18:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/108426#M16981</guid>
      <dc:creator>ramonarcusa36</dc:creator>
      <dc:date>2018-07-07T12:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting all but one values via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/1708527#M451604</link>
      <description>&lt;P&gt;Hello Marcus,&lt;/P&gt;&lt;P&gt;I have searched many things and this was one of the first to work, so thank you for this.&amp;nbsp; Although I still have one issue as my situation is a bit different that just the example below.&amp;nbsp; What can I do if I need to "select all" from a field, but exclude more than 1 of what is in that filed?&lt;/P&gt;&lt;P&gt;In like the example below say all European countries were listed and in this statement both France, Italy and England needed to be excluded?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 11:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-all-but-one-values-via-Macro/m-p/1708527#M451604</guid>
      <dc:creator>Gatter</dc:creator>
      <dc:date>2020-06-05T11:12:47Z</dc:date>
    </item>
  </channel>
</rss>

