<?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: Change sheet based on variable selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Change-sheet-based-on-variable-selection/m-p/52976#M8797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it seems I made that way more complicated than it needed to be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Whoops.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198422_Whoops.PNG" style="height: 126px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whoops&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Apr 2018 10:51:55 GMT</pubDate>
    <dc:creator>the_murkle_man</dc:creator>
    <dc:date>2018-04-04T10:51:55Z</dc:date>
    <item>
      <title>Change sheet based on variable selection</title>
      <link>https://community.qlik.com/t5/QlikView/Change-sheet-based-on-variable-selection/m-p/52975#M8796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've ran into a problem which so far has stumped me but I'm sure someone on here will have an answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my dashboard I have a homepage with various different buttons e.g. Revenue, Cost, Delivery etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These buttons then lead to a second menu page where users have the ability to select a Division/Country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This looks like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="198416" alt="Nav.PNG" class="jive-image image-1" height="211" src="https://community.qlik.com/legacyfs/online/198416_Nav.PNG" style="height: 210.532px; width: 458px;" width="458" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These buttons will then apply variables depending on what you clicked. For example clicking the upper left 'WAM' will show data for WAM UK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Historically all charts have been available in 1 tab with variables dictating what view users get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for the tricky part!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to separate this out into different tabs for Revenue, Cost etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I don't want to do if I can avoid it however is have to create the tab pictured above for each different sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea I had was to create another variable called 'vNav' which is assigned a value from the home page button you click on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So Revenue would be 1, Cost 2 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My intention then would be to assign a macro which would direct the document to the correct tab before applying the variables from the buttons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to create a macro something along the lines of;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15228383195063784" jivemacro_uid="_15228383195063784"&gt;
&lt;P&gt;Sub NavRev&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set v = ActiveDocumentGetVariable("nRev")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF v = 1 Then ActiveDocument.ActivateSheetByID "Revenue"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then IF v = 2 Then ActiveDocument.ActivateSheetByID "Cost"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else IF v = 3 Then ActiveDocument.ActivateSheetByID "Delivery"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End IF&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End IF&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is currently well off the mark and just crashes the document every time i execute it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully someone has an idea of what I'm trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 10:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-sheet-based-on-variable-selection/m-p/52975#M8796</guid>
      <dc:creator>the_murkle_man</dc:creator>
      <dc:date>2018-04-04T10:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change sheet based on variable selection</title>
      <link>https://community.qlik.com/t5/QlikView/Change-sheet-based-on-variable-selection/m-p/52976#M8797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it seems I made that way more complicated than it needed to be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Whoops.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198422_Whoops.PNG" style="height: 126px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whoops&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 10:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-sheet-based-on-variable-selection/m-p/52976#M8797</guid>
      <dc:creator>the_murkle_man</dc:creator>
      <dc:date>2018-04-04T10:51:55Z</dc:date>
    </item>
  </channel>
</rss>

