<?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 Help with Buttons in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267322#M1187428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've needed to create an example file for some time, so I'm going to go do that and then post it.&amp;nbsp; But in short, you set an additional variable, such as vNorthAmerica to getcurrentselections().&amp;nbsp; Then you base the color on whether or not getcurrentselections() returns the same value as what is in vNorthAmerica.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done this with macros in a live application.&amp;nbsp; I need to see if it works with actions too, though it's a little riskier, as I don't think there's any guarantee on a multi-core machine that the selections will be set before you set the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2011 23:04:59 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-08-11T23:04:59Z</dc:date>
    <item>
      <title>Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267321#M1187427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have set up a 3 buttons to help select a few standard selections from a list boxes. An example would be a button called “North America”, “International”, and “Global”. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“North America” (Button 1 Green Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actions &lt;/P&gt;&lt;P&gt;Select in Field – Field = CompanyCode, Search String= (5,60,120,210,240,243,303,399) &lt;/P&gt;&lt;P&gt;Set Variable – Variable=VRegion, Value = “North America”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional = IF($(vRegion) &amp;lt;&amp;gt; ‘North America’,1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“North America” (Button 2 Blue Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Set Variable – Variable =VRegion, Value = “North America”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional=IF($(vRegion) = 'North America',1,0) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600; text-decoration: underline;"&gt;&lt;STRONG&gt;The purpose of two buttons is a visual indicator of the current selection based on color&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“International” (Button 1 Green Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actions &lt;/P&gt;&lt;P&gt;Select in Field – Field = CompanyCode, Search String= (5,60,120,210,240,243,303,399)&lt;/P&gt;&lt;P&gt;Select Excluded – Field =CompanyCode&lt;/P&gt;&lt;P&gt;Set Variable – Variable=VRegion, Value = “International”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional = IF($(vRegion) &amp;lt;&amp;gt; ‘International’,1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“International” (Button 2 Blue Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Set Variable – Variable=VRegion, Value = “International”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional=IF($(vRegion) = ' International,1,0) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“Global” (Button 1 Green Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actions &lt;/P&gt;&lt;P&gt;Select in Field – Field = CompanyCode, Search String= Left Blank&lt;/P&gt;&lt;P&gt;Set Variable – Variable=VRegion, Value = “Global”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional = IF($(vRegion) &amp;lt;&amp;gt; ‘Global’,1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;“Global” (Button 2 Blue Color)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Set Variable – Variable=VRegion, Value = “Global”&lt;/P&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;P&gt;Conditional=IF($(vRegion) = ' Global,1,0) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The buttons work get as long as someone only uses these three buttons for selections but as soon as the clear button or the list box is used to make a selection the color coding of the buttons stops working. This happen because the variable is still set from the last button pushed even though the selected fields have changed using a list box on been cleared. Any idea how to fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 16:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267321#M1187427</guid>
      <dc:creator />
      <dc:date>2011-08-11T16:48:24Z</dc:date>
    </item>
    <item>
      <title>Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267322#M1187428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've needed to create an example file for some time, so I'm going to go do that and then post it.&amp;nbsp; But in short, you set an additional variable, such as vNorthAmerica to getcurrentselections().&amp;nbsp; Then you base the color on whether or not getcurrentselections() returns the same value as what is in vNorthAmerica.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done this with macros in a live application.&amp;nbsp; I need to see if it works with actions too, though it's a little riskier, as I don't think there's any guarantee on a multi-core machine that the selections will be set before you set the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 23:04:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267322#M1187428</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-11T23:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267323#M1187429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out I'd already created an example back when I was first trying to solve this problem, and I simply forgot I had it.&amp;nbsp; See attached.&amp;nbsp; Hopefully that will work for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 23:14:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267323#M1187429</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-11T23:14:08Z</dc:date>
    </item>
    <item>
      <title>Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267324#M1187430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;John,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;First off thanks for the help and the great example you provided. This has given me so much more than what I was asking for. I am not very experienced in macos so it’s going to take me a little bit to apply this in my app but it look like it will work. Your formatting the color with an expression vs my hiding and reappearing buttons is so much better.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I do have one additional question because of my lack of experience with macros. In your example how would I select “Type A” and “Type C” by excluding “Type B”? I want to accomplish this through exclusion because eventually I could add a “Type D” and “Type F” which I would want selected as well.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 15:29:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267324#M1187430</guid>
      <dc:creator />
      <dc:date>2011-08-12T15:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267325#M1187431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You select the value(s) you want excluded, then select the excluded values.&amp;nbsp; Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;set field = activedocument.fields("Type")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;field.select "Type B"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;field.selectexcluded&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 21:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267325#M1187431</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-12T21:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267326#M1187432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;John,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Your solution works but I am not 100% there. In your example I want to use the buttons to make selections for "type" only without resetting selections in "status" or "product". I would also like to be able to make selections in all list box except "Type" after a button has been used to set the "type" and keep that type's button color as active=green.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Examples:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Click button "Type A" it selects "Type A" in Type list box and the button turns green.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Select "Status L" from the Status list box and the "Type A" button stays green.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Clear all selections and button "Type A" turns back to grey.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Select "Product X", "Product Y", and "Status L"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Click button "Type A" and "Type A" is selected from the list box button turns green and your selections "Product X", "Product Y", and "Status L" stay active. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Not sure this is possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 01:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267326#M1187432</guid>
      <dc:creator />
      <dc:date>2011-08-16T01:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267327#M1187433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My macros are clearing all selections at the beginning.&amp;nbsp; Don't do that.&amp;nbsp; You can also get selections for a specific field instead of all selections.&amp;nbsp; So if you want a "not Type B" button, skip the clear, and then set the variable to only the selections for the Type field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for instance, in what I posted, I can replace the CZ macro with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sub CZ&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedocument.fields("Type").select "Type B"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedocument.fields("Type").selectexcluded&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedocument.variables("CZ").setcontent activedocument.evaluate("getfieldselections([Type])"),false&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;end sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it won't clear, will only set the type field, and then will only care about the type field when dealing with the color of the associated button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; Oops, need to change the button color expression to match.&amp;nbsp; This should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(getfieldselections([Type])=CZ,lightgreen(),lightgray())&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 18:53:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267327#M1187433</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-16T18:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Buttons</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267328#M1187435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;John it’s been a while and I am looking to expand on my button selections. Below is my example following our previous examples. I would like to a button to stay green until something is selected in “Type” filed then turn grey. The button works for clearing the type filed however the color doesn’t and I have a feeling it’s not working because no value is set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;sub All&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedocument.fields("Type").clear&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedocument.variables("vAll").setcontent activedocument.evaluate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;("getfieldselections([Type])"),false &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;end sub &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Button Color.&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN" style="font-family: 'Courier New'; color: #636363; font-size: 9pt;"&gt;if(getfieldselections([Type])=vAll,lightgreen(),lightgray())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN" style="font-family: 'Courier New'; color: #636363; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #333333; font-size: 10pt;"&gt;I was trying to avoid listing all types since they are continually being added. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 20:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Buttons/m-p/267328#M1187435</guid>
      <dc:creator />
      <dc:date>2011-10-13T20:12:25Z</dc:date>
    </item>
  </channel>
</rss>

