<?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 - How to select a specific value in Listbox on Sheet Selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216697#M69996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or TopSelect.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ActiveDocument.Fields("Year").TopSelect "Year", 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Oct 2009 10:01:23 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2009-10-15T10:01:23Z</dc:date>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216691#M69990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my first time using macros in Qlikview (and macros altogether in a very long time) I have a simple question regarding a macro when selecting a sheet.&lt;/P&gt;&lt;P&gt;I would like a specific listbox with years to be automatically selected with the latest year.&lt;/P&gt;&lt;P&gt;So on the OnActivateSheet Trigger, i have a macro which clears the selection:&lt;/P&gt;&lt;P style="font-style: italic"&gt;ActiveDocument.Fields("Year").Clear&lt;/P&gt;&lt;P&gt;How would I get the field to be selected with the latest year?&lt;/P&gt;&lt;P&gt;The 'Year' field is in a 'Dates' table which has been retrieved on the load.&lt;/P&gt;&lt;P&gt;Hopefully somebody can help.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 03:02:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216691#M69990</guid>
      <dc:creator />
      <dc:date>2009-10-15T03:02:02Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216692#M69991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's really essential in this case to know which version you are using, because with QV 9 there's no need for a macro.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 03:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216692#M69991</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-15T03:19:43Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216693#M69992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I just saw that you are using the term "Trigger", so I assume you HAVE QV 9.&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;OnActivateSheet Trigger is alright; BUT:&lt;/P&gt;&lt;P&gt;as action don't use "External/Run Macro" !!!! Use "Selection/Select in Field". There, for "field" you specify "Year", for "Search string" you specify "=max(Year)". That's all and it should run without macro programming.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 03:23:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216693#M69992</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-15T03:23:19Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216694#M69993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;P&gt;Actually I am using QV 8.5 so I don't see the "Selection/Select in Field". On the Macro tab, I see Sheet Event Triggers: OnActivateSheet and OnLeaveSheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 03:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216694#M69993</guid>
      <dc:creator />
      <dc:date>2009-10-15T03:35:23Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216695#M69994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in this case i first create a variable that hold max year: =max({1} Year)&lt;/P&gt;&lt;P&gt;(lets say that this variable is named vMaxYear). Variables menu is in Settings --&amp;gt; Variable overview&lt;/P&gt;&lt;P&gt;next macro part:&lt;/P&gt;&lt;P&gt;1. Clear Year field (you already achieve this)&lt;/P&gt;&lt;P&gt;2. get content of vYear: set maxYear = ActiveDocument.GetVariable("vMaxYear")&lt;/P&gt;&lt;P&gt;3. Make selection in Year field: ActiveDocument.Fields("Year").Select maxYear.GetContent.String&lt;/P&gt;&lt;P&gt;And put the created sub in OnActivateSheet or OnLeaveSheet&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 04:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216695#M69994</guid>
      <dc:creator />
      <dc:date>2009-10-15T04:28:55Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216696#M69995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is correct, but there is no need for varaible if use Evaluate:&lt;BR /&gt;&lt;B&gt;ActiveDocument.Fields("Year").Select ActiveDocument.Evaluate("max(Year)")&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 09:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216696#M69995</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-15T09:08:55Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216697#M69996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or TopSelect.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ActiveDocument.Fields("Year").TopSelect "Year", 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 10:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216697#M69996</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-10-15T10:01:23Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216698#M69997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both of the last 2 suggestions work for me. I could not get Stefan's to work but that is probably my fault.&lt;/P&gt;&lt;P&gt;However these solutions work to select the max year as long as the year is already selected. For example just say I have 3 years: 2007, 2008, 2009.&lt;/P&gt;&lt;P&gt;Before I select the sheet if:&lt;/P&gt;&lt;P&gt;1) 2007,2008,2009 are selected --&amp;gt; 2009 becomes selected&lt;/P&gt;&lt;P&gt;2) none are selected --&amp;gt; 2009 becomes selected&lt;/P&gt;&lt;P&gt;3) 2007,2008 are selected --&amp;gt; 2008 becomes selected ... however ideally I would like 2009 to becomes selected. Does anybody know how to achieve that?&lt;/P&gt;&lt;P&gt;Anyways the solution still works for me as the main thing is one year needs to be selected on this sheet.&lt;/P&gt;&lt;P&gt;Thanks everybody for your help!&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 21:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216698#M69997</guid>
      <dc:creator />
      <dc:date>2009-10-15T21:12:04Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216699#M69998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike, if you use "Evaluate", simply change expression to&lt;BR /&gt;("max(&lt;STRONG&gt;all&lt;/STRONG&gt; Year)")&lt;BR /&gt;It will ignore selections&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 23:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216699#M69998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-15T23:55:50Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216700#M69999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works! wow that was so simple.. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2009 01:10:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216700#M69999</guid>
      <dc:creator />
      <dc:date>2009-10-16T01:10:00Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216701#M70000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to utlize this thread, but I was struggling with the same sort of issue, but I can't seem to make this work.&lt;/P&gt;&lt;P&gt;I am using version 9, and tried what biester suggested: Document Properties &amp;gt; Triggers &amp;gt; OnOpen &amp;gt; Select in field.&lt;/P&gt;&lt;P&gt;In Field I have "[AP Date]" (stands for Accounts Payable date), and Search String "= Max ([AP Date])", but this does not choose the latest date in the list. What is wrong?&lt;/P&gt;&lt;P&gt;Thanks, - TP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 15:52:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216701#M70000</guid>
      <dc:creator />
      <dc:date>2009-11-16T15:52:29Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216702#M70001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it select any value? Can you post the qvw?&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 08:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216702#M70001</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-11-17T08:50:46Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216703#M70002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm also struggling with this. I´m trying to use the new functionality with triggers instead of using macros in order to improve the performance.&lt;/P&gt;&lt;P&gt;I'm having a variable generated in the script containing a Period. I then want to use this variable in my trigger in order to select a Year Month by default in the chart.&lt;/P&gt;&lt;P&gt;I´m trying to use the activity "Choose in field" and then use my variable as a search string to my field. For some reason this doesn´t work. It works fine if I hardcode a Period instead of using my variable.&lt;/P&gt;&lt;P&gt;Any idea anybody?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 19:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216703#M70002</guid>
      <dc:creator />
      <dc:date>2009-11-17T19:46:38Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216704#M70003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are the Trigger properties (OnOpen action): nothing is selected.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2063.APdate.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/2063.APdate.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 19:56:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216704#M70003</guid>
      <dc:creator />
      <dc:date>2009-11-17T19:56:49Z</dc:date>
    </item>
    <item>
      <title>MACRO - How to select a specific value in Listbox on Sheet Selection</title>
      <link>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216705#M70004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect ! Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works fine!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 20:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MACRO-How-to-select-a-specific-value-in-Listbox-on-Sheet/m-p/216705#M70004</guid>
      <dc:creator />
      <dc:date>2009-11-17T20:09:19Z</dc:date>
    </item>
  </channel>
</rss>

