<?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: Set default field selection using variable - possible?? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205372#M875439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MW,&lt;/P&gt;&lt;P&gt;As suggested, I went ahead to try out by setting actions.&amp;nbsp; OK, I figured out how to save my Year selection to a variable by means of Trigger -&amp;gt; Action.&amp;nbsp; But I can't seem to figure out to restore these values from the variable back to the Year listbox.&amp;nbsp; Suppose my vYearSel contains "2015,2016".&amp;nbsp;&amp;nbsp; How do I restore these selections?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 16:09:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-11-03T16:09:33Z</dc:date>
    <item>
      <title>Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205353#M875415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a macro which will do two things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Clear all selections (I know how to do).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Set a field selection based on the content of a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Example: I want to do something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set = vYearSel = '2016'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; in load script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("year").Select $(vYearSel)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; in macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I ran it, the macro failed to parse.&amp;nbsp;&amp;nbsp; If I hardcode the value in the macro, it will work which isn't what&amp;nbsp; I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know how I can accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205353#M875415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205354#M875416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This can be don without using a macro, but just using actions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you insist on using a macro, you need to get the value of the variable into VB something like this:&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vYearSel&lt;/SPAN&gt;")&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;strYearSel = v.GetContent.String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use strYearSel in your Select statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.Fields("year").Select strYearSel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205354#M875416</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-02T14:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205355#M875417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I surround the $ with quotes like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.Fields("year").Select "$(vYearSel) "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;It parsed successfully but I don't see my selection being made.&amp;nbsp; Not sure if this code actually ran or if it ran w/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;errors.&amp;nbsp; I did not see any errors on the screen.&amp;nbsp; Surrounding with double quotes probably isn't going to work.&amp;nbsp; It&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;may just treat it as a literal string.&amp;nbsp; But I just gave it a try ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:19:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205355#M875417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T14:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205356#M875418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MW,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried your code.&amp;nbsp; When I ran it, it opened the macro window which means something is wrong.&amp;nbsp; It doesn't like this &lt;/P&gt;&lt;P&gt;line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;strYearSel = v.GetContent.String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;I also replaced your variable with mine (vYearSel) which is in my load script, it didn't like it either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Anything I'm missing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:29:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205356#M875418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205357#M875419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also tried this and it didn't like it as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;msgbox(v.GetContent.String)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205357#M875419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T14:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205358#M875420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is really a lot simpler to do with actions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please post your code with my changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205358#M875420</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-02T15:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205359#M875422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the SUB.&amp;nbsp; I replaced your var with mine - vYearSel.&amp;nbsp; The last line that I tested/debugged is the msgbox().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub SetYearSel &lt;/P&gt;&lt;P&gt;&amp;nbsp; set v = ActiveDocument.Variables("vYearSel")&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'strYearSel = v.GetContent.String()&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'vYearSel = v.GetContent.String&lt;/P&gt;&lt;P&gt;&amp;nbsp; msgbox(v.GetContent.String)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'ActiveDocument.Fields("year").Select strYearSel&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:36:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205359#M875422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T15:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205360#M875425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sub SetYearSel&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = ActiveDocument.Variables("vYearSel")&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strYearSel = v.GetContent.String&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("year").Select strYearSel&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:54:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205360#M875425</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-02T16:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205361#M875428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very strange ...&amp;nbsp; This is what I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Copied your code exactly as you posted it.&lt;/P&gt;&lt;P&gt;2. Clicked the button which calls SetYearSel&lt;/P&gt;&lt;P&gt;3. Again, it opened the macro window.&amp;nbsp; Didn't work&lt;/P&gt;&lt;P&gt;4. Created a brand new document with only the Year listbox, your code and a button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Clicked the button and it worked.&amp;nbsp; So I know your code works.&lt;/P&gt;&lt;P&gt;5. Re-opened the problem document and removed everything except what's needed to run this (just like in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step 4) and it failed (macro window opened).&amp;nbsp; I checked the spelling of the variable in load script and the macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and there was nothing wrong.&lt;/P&gt;&lt;P&gt;6. Now what??&amp;nbsp; I decided to copy the variable (vYearSel) from the macro and replaced in my load script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; see screenshot.&amp;nbsp; Clicked the button and unbelievably it WORKED !!!.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="qv06.jpg" class="jive-image image-1" height="258" src="https://community.qlik.com/legacyfs/online/142728_qv06.jpg" style="height: 258.082px; width: 314px;" width="314" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So not sure what happened there?&amp;nbsp; I've run into this issue in QV before when a line of code (or a variable) didn't work even though I checked over and over again, I deleted it and re-typed and it worked.&amp;nbsp; In this case, I just did a &amp;lt;CRTL+C&amp;gt; and &amp;lt;CTRL+V&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a bug in QV?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 18:04:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205361#M875428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T18:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205362#M875429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slightly different question but related.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I click on a different tab/sheet meaning leaving the current sheet, what's the API to save the current&lt;/P&gt;&lt;P&gt;Year selection into a variable before activating the new sheet?&amp;nbsp; I know there's an event "OnLeave".&amp;nbsp; But what's the code to actually save it?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 18:16:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205362#M875429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T18:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205363#M875430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you explored 'On Open' Trigger option or 'Set Clear State' Option?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 19:23:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205363#M875430</guid>
      <dc:creator>rupamjyotidas</dc:creator>
      <dc:date>2016-11-02T19:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205364#M875431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the API Guide&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.GetVariable("Variable1")&lt;/P&gt;&lt;P&gt;v.SetContent "123",true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is an OnLeave event.&amp;nbsp; At the risk of nagging, this is all a lot simpler with actions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 19:29:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205364#M875431</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-02T19:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205365#M875432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MW,&lt;/P&gt;&lt;P&gt;I'm assuming the "123" you had there is the field selection value.&amp;nbsp; So going back to our earlier example with the Year.&lt;/P&gt;&lt;P&gt;If 2016 was selected in the Year listbox, How would I save this value into a variable in the Macro?&amp;nbsp; In other words, how you would not hard coding "123"??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 19:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205365#M875432</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-02T19:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205366#M875433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you are limiting the year listbox to always 1 selected value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set val=ActiveDocument.Fields("year").GetSelectedValues&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;strYear = val.Item(0).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;set v = ActiveDocument.GetVariable("&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vYearSel&lt;/SPAN&gt;")&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;v.SetContent &lt;SPAN style="font-size: 13.3333px;"&gt;strYear &lt;/SPAN&gt;,true&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 11:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205366#M875433</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-03T11:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205367#M875434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that there is a bug but invisible chars like in: &lt;A href="https://community.qlik.com/message/1086540"&gt;Re: Character limit for a SET command in an INCLUDE file?&lt;/A&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>Thu, 03 Nov 2016 13:21:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205367#M875434</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-11-03T13:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205368#M875435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MW,&lt;/P&gt;&lt;P&gt;I appreciate your help here.&amp;nbsp; I was able to gather pieces of code from your replies and put together a couple sub routines to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. OnLeaveSheet -&amp;gt; save my Year selection into a variable&lt;/P&gt;&lt;P&gt;2. OnActivateSheet -&amp;gt; restore the saved value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, there is an "OnLeaveSheet" event when you right click on sheet -&amp;gt; Properties.&amp;nbsp; Your earlier reply said there wasn't.&amp;nbsp; So just wanted to point that out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, now that I got code working and learning new things in QV.&amp;nbsp; Is this the most efficient way of doing 1 &amp;amp; 2&lt;/P&gt;&lt;P&gt;or there are better solutions and EASIER?&amp;nbsp; I honestly find using QV Object Model (I guess QV Developers would prefer to&lt;/P&gt;&lt;P&gt;call it QV API &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;) to be easy as well.&amp;nbsp; I just haven't been able to find a complete QV Object Model Reference yet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 13:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205368#M875435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-03T13:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205369#M875436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus, thanks.&amp;nbsp; Will watch out for this stuff next time.&amp;nbsp; I just know when things dont' work even thought I've checked, rechecked and rechecked syntax and spelling, I just delete them and re-type.&amp;nbsp; Most of the times, it will work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 13:43:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205369#M875436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-03T13:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205370#M875437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I have said many times in previous posts, this is easier with actions instead of macros. Add to that, macros generally work only with Internet Explorer and the QV Plugin (there are some exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the OnLeaveSheet trigger, you can add an Action that saves your Year selection into a variable.&lt;/P&gt;&lt;P&gt;In the OnActivateSheet trigger, you can add an action that selects the Year stored in the variable. No VB code is necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you found any of this useful, please mark replies as Helpful or Correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 15:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205370#M875437</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-11-03T15:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205371#M875438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your comments noted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 15:07:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205371#M875438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-03T15:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set default field selection using variable - possible??</title>
      <link>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205372#M875439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MW,&lt;/P&gt;&lt;P&gt;As suggested, I went ahead to try out by setting actions.&amp;nbsp; OK, I figured out how to save my Year selection to a variable by means of Trigger -&amp;gt; Action.&amp;nbsp; But I can't seem to figure out to restore these values from the variable back to the Year listbox.&amp;nbsp; Suppose my vYearSel contains "2015,2016".&amp;nbsp;&amp;nbsp; How do I restore these selections?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-default-field-selection-using-variable-possible/m-p/1205372#M875439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-03T16:09:33Z</dc:date>
    </item>
  </channel>
</rss>

