<?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: How do I save field selections in a macro variable and then pass them back? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211275#M873430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe using an &lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Alternate%20States.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Alternate%20States.htm"&gt;Alternate State &lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;could be an alternative here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2016 21:41:24 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2016-11-07T21:41:24Z</dc:date>
    <item>
      <title>How do I save field selections in a macro variable and then pass them back?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211272#M873427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a sheet that I do not want date selections applied to so I want to run a macro when the sheet opens to save the values in a variable and then clear the field selections.&amp;nbsp; On exiting the sheet I want to take the values stored in the variables and update the field values again.&amp;nbsp; I have the following for storing the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SiteCompareNoDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Set variables to store the date selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set DtSelStart = ActiveDocument.Fields("Start Date").GetSelectedValues&lt;/P&gt;&lt;P&gt;&amp;nbsp; set DtSelComp = ActiveDocument.Fields("Completed Date").GetSelectedValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Clear the date field selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ActiveDocument.Fields("Start Date").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp; ActiveDocument.Fields("Completed Date").Clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to create another macro that will reapply the values once I leave the sheet.&amp;nbsp; How would I accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jake Kibler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211272#M873427</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save field selections in a macro variable and then pass them back?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211273#M873428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest to use actions which set a variable-value per getfieldselections() or concat() instead of use of macros. Here you will get some ideas: &lt;A href="https://community.qlik.com/docs/DOC-17337"&gt;Tracking the historical selections&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 18:43:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211273#M873428</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-11-07T18:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save field selections in a macro variable and then pass them back?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211274#M873429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Originally I was.&amp;nbsp; I had sheet On Open triggers that were setting the variables (1 variable per field) then clearing the field selections.&amp;nbsp; Then actions sheet on leave that would take the values in each of the variables and set the field value back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked great when I was working on it locally, but when we deployed to our server which uses AJAX the sheet on open and on leave triggers do not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 18:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211274#M873429</guid>
      <dc:creator />
      <dc:date>2016-11-07T18:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save field selections in a macro variable and then pass them back?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211275#M873430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe using an &lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Alternate%20States.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Alternate%20States.htm"&gt;Alternate State &lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;could be an alternative here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 21:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211275#M873430</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-11-07T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save field selections in a macro variable and then pass them back?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211276#M873431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case macros won't help (rather the opposite especially within AJAX) because the issue is the trigger regardless if an action or a macro is behind them. But it's new for me that an ActivateSheet don't work (OnOpen is often difficult) maybe there is a conflict with multiple actions or with the QV release - which one is in use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this don't help you will need another kind of usability - maybe with alternate states like suggested from Marco or the disabling from the native sheet-navigation and replacing them with buttons/textboxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 06:52:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-save-field-selections-in-a-macro-variable-and-then-pass/m-p/1211276#M873431</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-11-08T06:52:02Z</dc:date>
    </item>
  </channel>
</rss>

