<?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 field selections with condition based on variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-clear-field-selections-with-condition-based-on-variable/m-p/350498#M129904</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want a macro to launch when a user selects a certain value for a variable in an input box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value of the variable varselect_mach= "Time Utilization" &lt;/P&gt;&lt;P&gt;certain fields should be cleared. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a real macro beginner, so I don't know if what I am asking is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have up to now is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sub clear_timefields&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;p = ActiveDocument.Variables("varselect_mach")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if p.GetContent.String = "Time Utilization"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;then&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;set lb = ActiveDocument.GetSheetObject("LB01")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;lb.Clear&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;end sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but this probably contains syntax errors...&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;STRONG style="color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Mar 2012 15:33:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-13T15:33:39Z</dc:date>
    <item>
      <title>Macro to clear field selections with condition based on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-clear-field-selections-with-condition-based-on-variable/m-p/350498#M129904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want a macro to launch when a user selects a certain value for a variable in an input box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value of the variable varselect_mach= "Time Utilization" &lt;/P&gt;&lt;P&gt;certain fields should be cleared. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a real macro beginner, so I don't know if what I am asking is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have up to now is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sub clear_timefields&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;p = ActiveDocument.Variables("varselect_mach")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if p.GetContent.String = "Time Utilization"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;then&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;set lb = ActiveDocument.GetSheetObject("LB01")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;lb.Clear&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;end sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but this probably contains syntax errors...&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;STRONG style="color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 15:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-clear-field-selections-with-condition-based-on-variable/m-p/350498#M129904</guid>
      <dc:creator />
      <dc:date>2012-03-13T15:33:39Z</dc:date>
    </item>
  </channel>
</rss>

