<?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 OnOpen Select ListBox value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219889#M72859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 2 list boxes that are loaded with data from an excel spreadsheet. 1 listbox uses field FiscalYear and The other uses FiscalPeriod. I also have written a query returning 2 fields from a database ReportYear and ReportMonth. 1 listbox contains all of the years from the spreadsheet and the other contains the months. What I want to do is have the default value in each listbox set to whatever value my query returns.&lt;/P&gt;&lt;P&gt;I have tried adding an OnOpen trigger in the document properties, but could not get that to work. Not sure if I am doing it wrong or if this is the wrong place to do this.&lt;/P&gt;&lt;P&gt;Here is what I have done Settings-&amp;gt;Document Properties-&amp;gt;Triggers&lt;/P&gt;&lt;P&gt;Added Select in Field action OnOpen&lt;/P&gt;&lt;P&gt;Choose field FiscalYear&lt;/P&gt;&lt;P&gt;added expression = Fields("ReportYear")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Apr 2010 20:37:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-20T20:37:03Z</dc:date>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219889#M72859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 2 list boxes that are loaded with data from an excel spreadsheet. 1 listbox uses field FiscalYear and The other uses FiscalPeriod. I also have written a query returning 2 fields from a database ReportYear and ReportMonth. 1 listbox contains all of the years from the spreadsheet and the other contains the months. What I want to do is have the default value in each listbox set to whatever value my query returns.&lt;/P&gt;&lt;P&gt;I have tried adding an OnOpen trigger in the document properties, but could not get that to work. Not sure if I am doing it wrong or if this is the wrong place to do this.&lt;/P&gt;&lt;P&gt;Here is what I have done Settings-&amp;gt;Document Properties-&amp;gt;Triggers&lt;/P&gt;&lt;P&gt;Added Select in Field action OnOpen&lt;/P&gt;&lt;P&gt;Choose field FiscalYear&lt;/P&gt;&lt;P&gt;added expression = Fields("ReportYear")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 20:37:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219889#M72859</guid>
      <dc:creator />
      <dc:date>2010-04-20T20:37:03Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219890#M72860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ryan, I think the trigger would only allow you to select one value in of the list boxes; to do that only change your expression to:&lt;/P&gt;&lt;P&gt;=ReportYear&lt;/P&gt;&lt;P&gt;If you want to have a value selected by default, you can click a single value in your list boxes and then go to the general tab and mark "always one selected value" option.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 21:24:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219890#M72860</guid>
      <dc:creator />
      <dc:date>2010-04-20T21:24:38Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219891#M72861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still could not get it to work...see screenshot below&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/3276.Screenshot.jpg"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/3276.Screenshot.jpg" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 14:48:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219891#M72861</guid>
      <dc:creator />
      <dc:date>2010-04-21T14:48:47Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219892#M72862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also Is it possible to debug the document? That way I can step through it to see what is happenning?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 15:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219892#M72862</guid>
      <dc:creator />
      <dc:date>2010-04-21T15:17:08Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219893#M72863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello ryan, I dont think it is possible to debug triggers, or at least, I haven't seen that yet. What I suggest is trying to hardcode a Year in you trigger value, for example 2009, to see if it works. Remeber that the expression:&lt;/P&gt;&lt;P&gt;= ReportYear&lt;/P&gt;&lt;P&gt;would only work if only one ReportYear is selected, probably you can try changing it to max(ReportYear), so it always return a value even if nothing is selected.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 15:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219893#M72863</guid>
      <dc:creator />
      <dc:date>2010-04-21T15:26:37Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219894#M72864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for helping me out on this, but maybe I didn't explain what I am trying to do well enough.&lt;/P&gt;&lt;P&gt;I have a listbox containing a list of Years. The field used in this listbox is FiscalYear and the data is loaded from an excel spreadsheet. I am also running a query against my database that gets the current open year for our company. The field I am loading in from the query is RepoirtYear. Now when the document loads I want to set FiscalYear to ReportYear(Select the particular year returned from the query). I have tried putting =ReportYear in the expression and that did not work, but I think you have to actually specify somewhere that I want the FiscalYear field to be changed to whatever value ReportYear is. The max function will not work because the year that I want to return may not always be the max year. I need to be able to set the selected value of the listbox(FiscalYear) to whatever is returned from my query(ReportYear). See my screenshot below maybe that will help.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/0143.Screenshot.jpg"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/0143.Screenshot.jpg" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 16:18:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219894#M72864</guid>
      <dc:creator />
      <dc:date>2010-04-21T16:18:18Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219895#M72865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 18:51:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219895#M72865</guid>
      <dc:creator />
      <dc:date>2010-04-21T18:51:00Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219896#M72866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have also tried editing the module&lt;/P&gt;&lt;P&gt;Tools-&amp;gt;Edit Module&lt;/P&gt;&lt;P&gt;Tried all of the following and none work&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select ReportYear&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select =ReportYear&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select "ReportYear"&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select "=ReportYear"&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select ActiveDocument.Fields("ReportYear")&lt;/P&gt;&lt;P&gt;Now this works&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("FiscalYear").Select "2009"&lt;/P&gt;&lt;P&gt;Also tried setting a variable at the top of the module, but I could not even declare a variable without getting an object required error.&lt;/P&gt;&lt;P&gt;See code Below&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; &l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t;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;("Test")&lt;/P&gt;vTest = "Test"&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;msgbox&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields(&lt;/P&gt;&lt;P&gt;"FiscalYear"). &lt;B&gt;Select&lt;/B&gt; vTest&lt;/P&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;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 20:21:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219896#M72866</guid>
      <dc:creator />
      <dc:date>2010-04-21T20:21:11Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219897#M72867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;This looks like the right approach. The fact that your text entry for 'Search String' is displayed in Red implies that maybe you mistyped the exact name of the ReportYear field? If you've correctly typed the fieldname it should display in green text.&lt;/P&gt;&lt;P&gt;The other possibility is that one or both of the "FiscalYear" and 'ReportYear' fields are full date datatypes and the comparison is not working because of the other elements of the date datatype. If so, you can use the YEAR function to simplify the data.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 21:07:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219897#M72867</guid>
      <dc:creator />
      <dc:date>2010-04-21T21:07:00Z</dc:date>
    </item>
    <item>
      <title>OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219898#M72868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone for your help. The problem was very simple. I needed to reload the data and then the field names showed in green and everything worked fine. It is always the small things. The clue about the field being red clued me in that it wasn't loading correctly. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 14:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219898#M72868</guid>
      <dc:creator />
      <dc:date>2010-04-22T14:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: OnOpen Select ListBox value</title>
      <link>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219899#M72869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;SPAN class="replyToName" style="font-size: 14px;"&gt;ivan_cruz&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am trying to make default selection of filed value as one always, but when i try to select the always select one value its, that option itself is disable.&lt;/P&gt;&lt;P&gt;Please help i need it urgently,&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 10:10:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OnOpen-Select-ListBox-value/m-p/219899#M72869</guid>
      <dc:creator />
      <dc:date>2013-05-14T10:10:58Z</dc:date>
    </item>
  </channel>
</rss>

