<?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: Setting Default values in List box in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53997#M8992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My approach on a similar occasion where i wanted my app to open with selected the lasta four years, including the current, was this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added this code in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp_Year1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Distinct Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SalesMasterDataCU&lt;/P&gt;&lt;P&gt;Where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(Year) &amp;gt;= if(Num(Month(Today()))=1,Year(Today())-1,Year(Today()))-3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(Year) &amp;lt;= if(Num(Month(Today()))=1,Year(Today())-1,Year(Today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp_Year2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(Year,'|') as YearS&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tmp_Year1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Tmp_Year1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYearsSelected=Peek('YearS',0,'Tmp_Year2');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Tmp_Year2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i added an OnOpen action in my app like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/205728_Capture.JPG" style="height: 431px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;In your case if you want to add an action on the Clear All event you should add an On Change action (and possibly an On Select action) on the Year field chcking with GetSelectedCount() function if the Year field if there are any selections in order to activate the default selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2018 11:24:12 GMT</pubDate>
    <dc:creator>dapostolopoylos</dc:creator>
    <dc:date>2018-06-20T11:24:12Z</dc:date>
    <item>
      <title>Setting Default values in List box</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53995#M8990</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 have 5 years in a list box as below.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Year.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/205724_Year.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;I want 3 years to be selected by default i.e. 2016,2017 and 2018 and in clear all button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to put action on clear all and giving field name and expression but it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I referred the below link in community.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlikview.com/thread/85786" title="https://community.qlikview.com/thread/85786"&gt;Setting default values in List box | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But its not working for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with possible answer .&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, 20 Jun 2018 11:00:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53995#M8990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-20T11:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Default values in List box</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53996#M8991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Try using an OnOpen trigger in Document properties settings with action Select in field,&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;Year&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;as field and&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;(2017|2018|2019)&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;as search string&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 11:10:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53996#M8991</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2018-06-20T11:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Default values in List box</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53997#M8992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My approach on a similar occasion where i wanted my app to open with selected the lasta four years, including the current, was this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added this code in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp_Year1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Distinct Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SalesMasterDataCU&lt;/P&gt;&lt;P&gt;Where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(Year) &amp;gt;= if(Num(Month(Today()))=1,Year(Today())-1,Year(Today()))-3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(Year) &amp;lt;= if(Num(Month(Today()))=1,Year(Today())-1,Year(Today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp_Year2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(Year,'|') as YearS&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tmp_Year1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Tmp_Year1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vYearsSelected=Peek('YearS',0,'Tmp_Year2');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Tmp_Year2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i added an OnOpen action in my app like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/205728_Capture.JPG" style="height: 431px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;In your case if you want to add an action on the Clear All event you should add an On Change action (and possibly an On Select action) on the Year field chcking with GetSelectedCount() function if the Year field if there are any selections in order to activate the default selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 11:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53997#M8992</guid>
      <dc:creator>dapostolopoylos</dc:creator>
      <dc:date>2018-06-20T11:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Default values in List box</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53998#M8993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 13:27:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Default-values-in-List-box/m-p/53998#M8993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-20T13:27:53Z</dc:date>
    </item>
  </channel>
</rss>

