<?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: Changing Variable Value When Field Is Cleared Of Selections in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064213#M87293</link>
    <description>&lt;P&gt;The best solution I can seem to find is the following:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;if(GetSelectedCount(TransactionDate, 'WoW')&amp;lt;1, 0,1)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;'WoW' being the name of the state. The problem is it doesn't clear when the field is cleared of selections.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 12:38:57 GMT</pubDate>
    <dc:creator>cgT</dc:creator>
    <dc:date>2023-04-25T12:38:57Z</dc:date>
    <item>
      <title>Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063698#M87251</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have a field called 'TransactionDate' which, when I clear it, needs to change the value of a variable, vLastWeekTrans, to 0.&lt;/P&gt;
&lt;P&gt;I'm trying to use the current expression in the variable's 'Definition' box and am not getting any result:&lt;/P&gt;
&lt;PRE&gt;=if(GetSelectedCount(TransactionDate)&amp;lt;1, 0,1)&lt;/PRE&gt;
&lt;P&gt;Thanks in advance for any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:43:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063698#M87251</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-24T13:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063721#M87252</link>
      <description>&lt;P&gt;It works for me&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sabrina_V_0-1682345735715.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/105645i02EE5FC2C7549FA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sabrina_V_0-1682345735715.png" alt="Sabrina_V_0-1682345735715.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sabrina_V_1-1682345760289.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/105646i8F2B130CA3159A97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sabrina_V_1-1682345760289.png" alt="Sabrina_V_1-1682345760289.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Definition of the variable&amp;nbsp;if(GetSelectedCount(TransactionDate)&amp;lt;1, 0,1) (without the equal sign)&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 14:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063721#M87252</guid>
      <dc:creator>Sabrina_V</dc:creator>
      <dc:date>2023-04-24T14:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063746#M87253</link>
      <description>&lt;P&gt;Thanks Sabrina,&lt;/P&gt;
&lt;P&gt;I've tried this and, once I've updated the definition, it works (i.e. it changes the variable value). I click the button again and then clear the selection and it doesn't work.&lt;/P&gt;
&lt;P&gt;Could there be anything that overrules the definition of a variable?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 14:47:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063746#M87253</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-24T14:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063748#M87254</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sabrina_V_0-1682347858900.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/105648iD0B790026FC36166/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sabrina_V_0-1682347858900.png" alt="Sabrina_V_0-1682347858900.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try multiple times and it works fine for me. Could you add your app ?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 14:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063748#M87254</guid>
      <dc:creator>Sabrina_V</dc:creator>
      <dc:date>2023-04-24T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063795#M87260</link>
      <description>&lt;P&gt;I can add without data if that's ok?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 15:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063795#M87260</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-24T15:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063796#M87261</link>
      <description>&lt;P&gt;Here is the app. The variable is acting on the background and font colours in the first button on the left underneath the blue banner.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 15:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063796#M87261</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-24T15:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063992#M87276</link>
      <description>&lt;P&gt;In your buttons you force the value of your variable&amp;nbsp;&lt;SPAN&gt;vLastWeekTrans to&amp;nbsp; 1 =&amp;gt; It's clear th definition.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Two solutions :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. In the definition of the variable put the formula&amp;nbsp;if(GetSelectedCount(TransactionDate)&amp;lt;1, 0,1) (without the equal sign) and nothing in the button&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. If you absolutely want the action on the button : create the variable without definition and then in each button on the action on the variable put the formula&amp;nbsp;if(GetSelectedCount(TransactionDate)&amp;lt;1, 0,1) (without the equal sign)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 06:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2063992#M87276</guid>
      <dc:creator>Sabrina_V</dc:creator>
      <dc:date>2023-04-25T06:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064091#M87283</link>
      <description>&lt;P&gt;This is working really well, thank you Sabrina!&lt;/P&gt;
&lt;P&gt;I have one button that's in an alternate state and this method isn't working for that button. Is there an adjustment I need to make when dealing with variables in alternate states?&lt;/P&gt;
&lt;P&gt;Many thanks once again.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 08:53:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064091#M87283</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-25T08:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064098#M87284</link>
      <description>&lt;P&gt;Please see this issue : &lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Variables-alternate-state/m-p/810355" target="_self"&gt;LINK&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 09:06:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064098#M87284</guid>
      <dc:creator>Sabrina_V</dc:creator>
      <dc:date>2023-04-25T09:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064213#M87293</link>
      <description>&lt;P&gt;The best solution I can seem to find is the following:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;if(GetSelectedCount(TransactionDate, 'WoW')&amp;lt;1, 0,1)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;'WoW' being the name of the state. The problem is it doesn't clear when the field is cleared of selections.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 12:38:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064213#M87293</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-25T12:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Variable Value When Field Is Cleared Of Selections</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064847#M87337</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm still unable to get the alternate state to work on the button. But I'm also having another issue. Without changing anything, I'm now seeing the button background and font changing only after a second click of the button. Also, the clearing of the field no longer sets the variable to '0'.&lt;/P&gt;
&lt;P&gt;I've attached my app, sans data, for somebody to look at if possible please.&lt;/P&gt;
&lt;P&gt;Many thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 13:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Variable-Value-When-Field-Is-Cleared-Of-Selections/m-p/2064847#M87337</guid>
      <dc:creator>cgT</dc:creator>
      <dc:date>2023-04-26T13:32:02Z</dc:date>
    </item>
  </channel>
</rss>

