<?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 Macro to Clear all selections except dates? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145386#M24110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that is possible. ClearAllButThis seems to only work for one field.&lt;/P&gt;&lt;P&gt;I think if you want to avoid Lock, it gets more complicated. This should work (I tried it using one field):&lt;/P&gt;&lt;P&gt;set yearSelect = ActiveDocument.Fields("Year").GetSelectedValues&lt;BR /&gt; set qtrSelect = ActiveDocument.Fields("Quarter").GetSelectedValues&lt;BR /&gt; set dateSelect = ActiveDocument.Fields("Date").GetSelectedValues&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll&lt;/P&gt;&lt;P&gt;set fv = ActiveDocument.Fields("Year").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to yearSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = yearSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Year").SelectValues fv&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; set fv = ActiveDocument.Fields("Quarter").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to qtrSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = qtrSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Quarter").SelectValues fv&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; set fv = ActiveDocument.Fields("Date").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to dateSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = dateSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Date").SelectValues fv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 May 2009 03:11:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-29T03:11:49Z</dc:date>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145383#M24107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All, i have been searching the archives for any easy sub routine that would clear all active fields EXCPET Year, Quarter and Date...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 02:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145383#M24107</guid>
      <dc:creator>james</dc:creator>
      <dc:date>2009-05-29T02:39:52Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145384#M24108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could lock those fields, clear all and then unlock them?&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Year").Lock&lt;BR /&gt;ActiveDocument.Fields("Quarter").Lock&lt;BR /&gt;ActiveDocument.Fields("Date").Lock&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Year").Unlock&lt;BR /&gt;ActiveDocument.Fields("Quarter").Unlock&lt;BR /&gt;ActiveDocument.Fields("Date").Unlock&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 02:54:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145384#M24108</guid>
      <dc:creator />
      <dc:date>2009-05-29T02:54:07Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145385#M24109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;True, but I was trying this out as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Year").ClearAllButThis&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Month").ClearAllButThis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;However, it doesn't work since it doesn't like multiple fields..... Anyone know how to select ActiveDocument.Fields("Year")("Month".ClearAllButThis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 02:58:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145385#M24109</guid>
      <dc:creator>james</dc:creator>
      <dc:date>2009-05-29T02:58:50Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145386#M24110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that is possible. ClearAllButThis seems to only work for one field.&lt;/P&gt;&lt;P&gt;I think if you want to avoid Lock, it gets more complicated. This should work (I tried it using one field):&lt;/P&gt;&lt;P&gt;set yearSelect = ActiveDocument.Fields("Year").GetSelectedValues&lt;BR /&gt; set qtrSelect = ActiveDocument.Fields("Quarter").GetSelectedValues&lt;BR /&gt; set dateSelect = ActiveDocument.Fields("Date").GetSelectedValues&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll&lt;/P&gt;&lt;P&gt;set fv = ActiveDocument.Fields("Year").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to yearSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = yearSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Year").SelectValues fv&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; set fv = ActiveDocument.Fields("Quarter").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to qtrSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = qtrSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Quarter").SelectValues fv&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; set fv = ActiveDocument.Fields("Date").GetNoValues&lt;/P&gt;&lt;P&gt;for i = 0 to dateSelect.Count - 1&lt;BR /&gt; fv.Add&lt;/P&gt;&lt;P&gt;fv(i).Text = dateSelect.Item(i).Text&lt;BR /&gt; fv(i).IsNumeric = false&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Date").SelectValues fv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 03:11:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145386#M24110</guid>
      <dc:creator />
      <dc:date>2009-05-29T03:11:49Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145387#M24111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think it's necessary to build a new array "fv". The objects returned by GetSelectedValues are already in the correct format for Selectvalues.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;set yearSelect = ActiveDocument.Fields("Year").GetSelectedValues&lt;BR /&gt;set qtrSelect = ActiveDocument.Fields("Quarter").GetSelectedValues&lt;BR /&gt;set dateSelect = ActiveDocument.Fields("Date").GetSelectedValues&lt;BR /&gt;ActiveDocument.ClearAll&lt;BR /&gt;ActiveDocument.Fields("Year").SelectValues yearSelect&lt;BR /&gt;ActiveDocument.Fields("Quarter").SelectValues qtrSelect&lt;BR /&gt;ActiveDocument.Fields("Date").SelectValues dateSelect&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 07:30:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145387#M24111</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-05-29T07:30:21Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145388#M24112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Rob Wunderlich wrote:&lt;BR /&gt;I don't think it's necessary to build a new array "fv". The objects returned by GetSelectedValues are already in the correct format for Selectvalues.&lt;BR /&gt;-Rob&lt;BR /&gt; &amp;lt;blockquote&amp;gt;set yearSelect = ActiveDocument.Fields("Year").GetSelectedValues&lt;BR /&gt;set qtrSelect = ActiveDocument.Fields("Quarter").GetSelectedValues&lt;BR /&gt;set dateSelect = ActiveDocument.Fields("Date").GetSelectedValues&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.ClearAll&lt;BR /&gt;ActiveDocument.Fields("Year").SelectValues yearSelect&lt;BR /&gt;ActiveDocument.Fields("Quarter").SelectValues qtrSelect&lt;BR /&gt;ActiveDocument.Fields("Date").SelectValues dateSelect&amp;lt;pre&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="CLEAR:both;"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob My issue is I cant get another Sub Routine to call up those "Selections" once I get back to a sheet I want to apply them too. Thus I created a macro that makes a bookmark for said data and than that Macro is applied on open sheets where I needed it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 08:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145388#M24112</guid>
      <dc:creator>james</dc:creator>
      <dc:date>2009-05-29T08:26:38Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145389#M24113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was assuming, based on the previous post, that the sequence of save/clear/restore all happened in one Sub.&lt;/P&gt;&lt;P&gt;However, if the save and restore occur in different subs, you can declare the *Select objects as global variables (outside a Sub) and then they can be referenced by either Sub.&lt;/P&gt;&lt;P&gt;If your bookmark solution is working, that sounds like a good solution also.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 May 2009 04:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145389#M24113</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-05-30T04:47:26Z</dc:date>
    </item>
    <item>
      <title>Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145390#M24114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;BR /&gt;It would be so much easier to help you if you described your problem from the very beginning&lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;BR /&gt;Yes, bookmark is not a bad solution. I just want to mention that I had to resolve a simuilar problem once, and couldn't use bookmark. So, I created a set of hidden "copy fields" for Year, Month, and Date as a logical island. One macro copied the selections from the "real" fields to these hidden fields, and another macro copied selections from hidden to "real".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2009 00:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145390#M24114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-31T00:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Clear all selections except dates?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145391#M24115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;this can be annoying, i wrote a code that will only clear the fields that are selected, you can check this qvw, this also allows you to just list those fields in an island instead of repeating code. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Oct 2017 13:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-Clear-all-selections-except-dates/m-p/145391#M24115</guid>
      <dc:creator>yakir_manor</dc:creator>
      <dc:date>2017-10-08T13:52:04Z</dc:date>
    </item>
  </channel>
</rss>

