<?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: Macro get content of variable doesn't work in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807164#M284943</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;It is not suggested to use macros if you can achieve the same without using the macros.&amp;nbsp; Always try to avoid macros, some doesn't works in Ajax mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway to achieve your requirement use below macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB setVariable()&lt;BR /&gt; set v = ActiveDocument.GetVariable("vTemp") &lt;BR /&gt; vTempValue = v.GetContent.String &lt;BR /&gt; set v = ActiveDocument.GetVariable("path") &lt;BR /&gt; v.SetContent Replace(v.GetContent.String, "{1}", vTempValue), true&lt;BR /&gt; END SUB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;Jagan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jan 2015 02:06:00 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2015-01-02T02:06:00Z</dc:date>
    <item>
      <title>Macro get content of variable doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807162#M284941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tried to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = ActiveDocument.Variables("vTemp").GetContent.String&lt;/P&gt;&lt;P&gt;path = Replace(path,&amp;nbsp; "{1}", temp) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I get nothing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I declare the variable in the module like this,&amp;nbsp; it works :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = "temp" &lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;path = Replace(path,&amp;nbsp; "{1}", temp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "vTemp" variable declared in the Variable Overview. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the problem? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 12:59:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807162#M284941</guid>
      <dc:creator />
      <dc:date>2015-01-01T12:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro get content of variable doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807163#M284942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you calling the macro from the script or from the UI?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 18:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807163#M284942</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-01T18:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro get content of variable doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807164#M284943</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;It is not suggested to use macros if you can achieve the same without using the macros.&amp;nbsp; Always try to avoid macros, some doesn't works in Ajax mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway to achieve your requirement use below macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB setVariable()&lt;BR /&gt; set v = ActiveDocument.GetVariable("vTemp") &lt;BR /&gt; vTempValue = v.GetContent.String &lt;BR /&gt; set v = ActiveDocument.GetVariable("path") &lt;BR /&gt; v.SetContent Replace(v.GetContent.String, "{1}", vTempValue), true&lt;BR /&gt; END SUB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;Jagan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2015 02:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-get-content-of-variable-doesn-t-work/m-p/807164#M284943</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-01-02T02:06:00Z</dc:date>
    </item>
  </channel>
</rss>

