<?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: Macro for Clearing selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389272#M145266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about simply placing the 2 sheets each in a different alternate state ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will achieve exactly what you want, as in the selections of the 2 sheets being independent of each other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is dead easy to do and avoids messing about with macros which will not work with the Ajax client.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Aug 2014 17:26:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-08-12T17:26:13Z</dc:date>
    <item>
      <title>Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389267#M145261</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;&lt;/P&gt;&lt;P&gt;I created two sheets namely sheet1 and sheet2. I don't want sheet1 selections to be affected on sheet2 . Here the list box in sheet1 is checked with 'Always one selected value'.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I had selected some filters on sheet1 and when I switch to second sheet it should get cleared . At the same time when i come back to sheet1 it should have the same selections .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this , I used the bookmarks trigger on sheet properties. It leads me to the issue that&amp;nbsp; whenever I switch from sheet 2 to Sheet1 , It shows me the same selections which created bookmark for the first time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, however I managed to write a macro by surfing so many blogs eventhough I am new to macro's section in qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sub AlwaysOneSelected&lt;BR /&gt;Set QvObj=Activedocument.GetSheetObject("LB28")&lt;BR /&gt;Set MyField=QvObj.GetField&lt;BR /&gt;Set FieldProp=MyField.GetProperties&lt;BR /&gt;FieldProp.OneAndOnlyOne=True&lt;BR /&gt;MyField.SetProperties FieldProp&lt;BR /&gt;End Sub &lt;BR /&gt;&lt;BR /&gt;Sub RemoveOnlyOneSelected&lt;BR /&gt;Set QvObj=Activedocument.GetSheetObject("LB28")&lt;BR /&gt;Set MyField=QvObj.GetField&lt;BR /&gt;Set FieldProp=MyField.GetProperties&lt;BR /&gt;FieldProp.OneAndOnlyOne=False&lt;BR /&gt;MyField.SetProperties FieldProp&lt;BR /&gt;ActiveDocument.ClearAll True&lt;BR /&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;After writing macro I used the external and Select in field triggers&amp;nbsp; on sheets but it again leads me to the same issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Can someone please help me in correcting this macro ? or any new solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thannks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;PS: I am using qlikview 10&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Priya &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:29:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389267#M145261</guid>
      <dc:creator />
      <dc:date>2013-03-25T15:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389268#M145262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whenever I want to Clear a specific Field I use this line of Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ActiveDocument.Fields("&lt;STRONG&gt;FieldName&lt;/STRONG&gt;").Clear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:31:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389268#M145262</guid>
      <dc:creator />
      <dc:date>2013-03-25T15:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389269#M145263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply Brian.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I told am new to macro sections. Can you&amp;nbsp; please tell me clearly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389269#M145263</guid>
      <dc:creator />
      <dc:date>2013-03-25T15:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389270#M145264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an Example where I Clear a Field and Toggle a Variable while selecting a new value for that field&lt;/P&gt;&lt;P&gt;Replicating a On / Off State. vOpps is the Variable Name I use to control the If statement or Toggle effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 0 or 1 can be defined any way you want&amp;nbsp; 0 = off &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;.Clear&lt;/STRONG&gt; is the Method used against the specified field in parens ()&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;sub ToggleOpps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.GetVariable("vOpps") 'first create a variable&lt;/P&gt;&lt;P&gt;Cnt= v.getcontent.String&lt;/P&gt;&lt;P&gt;'prop = myobj.GetProperties&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Cnt=0 then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("&lt;STRONG&gt;FlgOpp&lt;/STRONG&gt;").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetField("&lt;STRONG&gt;FlgOpp&lt;/STRONG&gt;").Select&lt;STRONG&gt; "0"&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Hide Opps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v.setContent "1",true&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Hide Opps&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("&lt;STRONG&gt;FlgOpp&lt;/STRONG&gt;").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'ActiveDocument.GetField("&lt;STRONG&gt;FlgOpp&lt;/STRONG&gt;").Select &lt;STRONG&gt;"1" &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; 'Show Opps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v.setContent "0",true&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Show Opps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389270#M145264</guid>
      <dc:creator />
      <dc:date>2013-03-25T15:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389271#M145265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A great way of starting a clean selection each time you activate a sheet is using Qlikview's built-in 'clear' OnActiveSheet feature. This is not a direct answer to your question, but i note here since its a useful feature. Perhaps the macros are not necessarily needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Setting -&amp;gt; Document Properties -&amp;gt; select Sheets tab -&amp;gt; click on the SheetID/Title you want to have cleared on activating -&amp;gt; click on Properties (note -- if you have not selected the sheet you want to apply this to, Properties will be greyed out) -&amp;gt; Click Add Action or Edit Action(s) under 'OnActiveSheet' -&amp;gt; Click Add -&amp;gt; select Action Type 'Selection' and Action 'Clear All'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each time you then activate the given Sheet, the 'Current Selections' will be cleared. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 17:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389271#M145265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-12T17:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Clearing selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389272#M145266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about simply placing the 2 sheets each in a different alternate state ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will achieve exactly what you want, as in the selections of the 2 sheets being independent of each other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is dead easy to do and avoids messing about with macros which will not work with the Ajax client.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 17:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-Clearing-selections/m-p/389272#M145266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-12T17:26:13Z</dc:date>
    </item>
  </channel>
</rss>

