<?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: Button for value-selection only when nothing is selected already in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550375#M205552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want the previous selection to be intact and the new ones as additional, try 'Toggle Select' in action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Or, for your case try using an additional trigger 'Clear Field' for the same button above the existing one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2014 12:16:23 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2014-01-22T12:16:23Z</dc:date>
    <item>
      <title>Button for value-selection only when nothing is selected already</title>
      <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550374#M205551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my QV-App I want to use a button to select some field values. In one field (called LS_BEST_MONAT), a new selection should only be made when there is nothing selected yet. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a listbox for that field, it contains year-month values like:&lt;/P&gt;&lt;P&gt;2013-10&lt;/P&gt;&lt;P&gt;2013-11&lt;/P&gt;&lt;P&gt;2013-12&lt;/P&gt;&lt;P&gt;2014-01&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;There are also NULL-Values ( - ) possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When there is no selection in this field, pressing the button should select previous month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code for the button-action 'Select in field [LS_BEST_MONAT]':&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(LS_BEST_MONAT)=0, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(AddMonths(Now(),-1))&amp;amp;'-'&amp;amp;num(Month(AddMonths(Now(),-1)),'00')&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works when there were no slections on that field before pressing the button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But IF there were selections before, after pressing the button the &lt;STRONG&gt;NULL&lt;/STRONG&gt;-Values of this field are selected. But in this case, I don't want the previous selection to change, it should stay as it is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to add else-condition:&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(LS_BEST_MONAT)=0, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(AddMonths(Now(),-1))&amp;amp;'-'&amp;amp;num(Month(AddMonths(Now(),-1)),'00')&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; ,GetFieldSelections( LS_BEST_MONAT)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with this the previous selection simply gets de-selected, so that nothing is selected for this field anymore. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 12:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550374#M205551</guid>
      <dc:creator />
      <dc:date>2014-01-22T12:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Button for value-selection only when nothing is selected already</title>
      <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550375#M205552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want the previous selection to be intact and the new ones as additional, try 'Toggle Select' in action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Or, for your case try using an additional trigger 'Clear Field' for the same button above the existing one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 12:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550375#M205552</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-01-22T12:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Button for value-selection only when nothing is selected already</title>
      <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550376#M205553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your Select in Field properties as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field:&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(LS_BEST_MONAT)=0, 'LS_BEST_MONAT')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search String:&lt;/P&gt;&lt;P&gt;=Year(AddMonths(Now(),-1))&amp;amp;'-'&amp;amp;num(Month(AddMonths(Now(),-1)),'00')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 14:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550376#M205553</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-22T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Button for value-selection only when nothing is selected already</title>
      <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550377#M205554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works perfect, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 14:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550377#M205554</guid>
      <dc:creator />
      <dc:date>2014-01-22T14:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Button for value-selection only when nothing is selected already</title>
      <link>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550378#M205555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad it works for you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 14:39:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Button-for-value-selection-only-when-nothing-is-selected-already/m-p/550378#M205555</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-22T14:39:46Z</dc:date>
    </item>
  </channel>
</rss>

