<?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 Macro Merge in Button in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189355#M52272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you should use only one variable&lt;/P&gt;&lt;P&gt;In the first chart, on the display condition put =vShow&lt;BR /&gt;In the second chart, on the display condition put =not vShow&lt;BR /&gt;Keep only one macro, in your macro you have to do something like vshow.value = not vshowvalue . (Sorry I don't remember the exact syntax bout I think you should use the ActiveDocument.Variables("vShow").GetContent method to get the actual value).&lt;/P&gt;&lt;P&gt;Then to manage the button name. You can use an if statement like if vShow then 'Effort' else 'Ticket' end if (This is the idea not the right syntax :)). You can use it directly in the button expressions or in Macro if you prefer.&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;sorry if I misunderstood your demand &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 16:19:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-16T16:19:54Z</dc:date>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189354#M52271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have two macros for two separate buttons. I want to merge these two buttons. I have looked at other posts which do similar stuff but cannot seem to get them to work. Basically one sheet is overlayed with another in a tab. I would like to be able to switch between each 'layer'.&lt;/P&gt;&lt;P&gt;my two macros are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Sub ShowTicket&lt;BR /&gt;set v = ActiveDocument.Variables("vShow")&lt;BR /&gt;v.SetContent "Ticket",true&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Sub ShowEffort&lt;BR /&gt;set v = ActiveDocument.Variables("vShow")&lt;BR /&gt;v.SetContent "Effort",true&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I would like to be able to toggle via either and also with the name changing on the button for each. My attempt ended up making all the charts disappear!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189354#M52271</guid>
      <dc:creator />
      <dc:date>2009-12-16T16:02:19Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189355#M52272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you should use only one variable&lt;/P&gt;&lt;P&gt;In the first chart, on the display condition put =vShow&lt;BR /&gt;In the second chart, on the display condition put =not vShow&lt;BR /&gt;Keep only one macro, in your macro you have to do something like vshow.value = not vshowvalue . (Sorry I don't remember the exact syntax bout I think you should use the ActiveDocument.Variables("vShow").GetContent method to get the actual value).&lt;/P&gt;&lt;P&gt;Then to manage the button name. You can use an if statement like if vShow then 'Effort' else 'Ticket' end if (This is the idea not the right syntax :)). You can use it directly in the button expressions or in Macro if you prefer.&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;sorry if I misunderstood your demand &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189355#M52272</guid>
      <dc:creator />
      <dc:date>2009-12-16T16:19:54Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189356#M52273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a chunk of code I use to swop the value of a variable and the button text:&lt;/P&gt;&lt;P&gt;CurrVal = ActiveDocument.Variables("vAccum").GetContent.String&lt;BR /&gt;NewVal=CurrVal&lt;BR /&gt;set button1 = ActiveDocument.getsheetobject("BU02")&lt;BR /&gt;set propB = button1.GetProperties&lt;/P&gt;&lt;P&gt;Select Case CurrVal ' 0=no acc 1=full acc&lt;BR /&gt; Case "0"&lt;BR /&gt; NewVal = "1"&lt;BR /&gt; propB.Text.v = "No accum"&lt;BR /&gt; Case Else ' 1 expected but fail safe if unknown&lt;BR /&gt; NewVal = "0"&lt;BR /&gt; propB.Text.v = "Full accum"&lt;BR /&gt;End Select&lt;/P&gt;&lt;P&gt;However, I would now use two buttons that were enabled/disabled depending on the variable value. Why? well the manuals consistently say that in server you should not change an objects attributes - it does work and everyone does it but as there is an alternative I prefer to use it just in case!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;ActiveDocument.Variables("vAccum").SetContent NewVal, true&lt;/P&gt;&lt;P&gt;button1.SetProperties propB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 17:05:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189356#M52273</guid>
      <dc:creator />
      <dc:date>2009-12-16T17:05:05Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189357#M52274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that should read:&lt;/P&gt;&lt;P&gt;CurrVal = ActiveDocument.Variables("vAccum").GetContent.String&lt;BR /&gt;NewVal=CurrVal&lt;BR /&gt;set button1 = ActiveDocument.getsheetobject("BU02")&lt;BR /&gt;set propB = button1.GetProperties&lt;/P&gt;&lt;P&gt;Select Case CurrVal ' 0=no acc 1=full acc&lt;BR /&gt; Case "0"&lt;BR /&gt; NewVal = "1"&lt;BR /&gt; propB.Text.v = "No accum"&lt;BR /&gt; Case Else ' 1 expected but fail safe if unknown&lt;BR /&gt; NewVal = "0"&lt;BR /&gt; propB.Text.v = "Full accum"&lt;BR /&gt;End Select&lt;/P&gt;&lt;P&gt;ActiveDocument.Variables("vAccum").SetContent NewVal, true&lt;/P&gt;&lt;P&gt;button1.SetProperties propB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 17:06:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189357#M52274</guid>
      <dc:creator />
      <dc:date>2009-12-16T17:06:01Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189358#M52275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My vShow variable is currently 'Effort'. Should this be changed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 17:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189358#M52275</guid>
      <dc:creator />
      <dc:date>2009-12-16T17:07:45Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189359#M52276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the info Gordon. i'll test both and see which is most suitable for my sheet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 17:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189359#M52276</guid>
      <dc:creator />
      <dc:date>2009-12-16T17:22:01Z</dc:date>
    </item>
    <item>
      <title>Macro Merge in Button</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189360#M52277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To adapt the Gordon's exemple to your case, I think you just have to replace 'No Accumulation' / 'Full Accumulation' by 'Efforts' and 'Tickets'&lt;/P&gt;&lt;P&gt;to workaround the button change properties, I would suggest a little change in the code above : replace the propB object by a variable which contains the button name (let's call it vButtonName). Then in the QlikView button interface, set the General / Text Value expression to =vButtonName. So you shouldn't need to use two buttons.&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 17:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Merge-in-Button/m-p/189360#M52277</guid>
      <dc:creator />
      <dc:date>2009-12-16T17:26:48Z</dc:date>
    </item>
  </channel>
</rss>

