<?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: Adding Dynamic Dimension using local variable in a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-Dynamic-Dimension-using-local-variable-in-a-macro/m-p/1395886#M423757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These dimensions/expressions variables contain only strings and are no objects and should be therefore not declared with "set". I'm not sure if Qlik needs here the double-quotes arounds the variable but you could try it if it's not working so far with: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;chart.AddDimension chr(34) &amp;amp; testDimension &amp;amp; chr(34)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Macus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Dec 2017 16:51:27 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2017-12-13T16:51:27Z</dc:date>
    <item>
      <title>Adding Dynamic Dimension using local variable in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Dynamic-Dimension-using-local-variable-in-a-macro/m-p/1395885#M423756</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 a requirement to automate the process of exporting the charts to PPT and excel.&lt;/P&gt;&lt;P&gt;For the same, I have written a macro, which will directly take all the inputs to create a chart from a config file and create the charts on the fly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a problem while adding dimensions and Expressions to the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me by letting me know whether there is a possibility to add the dimensions using a variable.&lt;/P&gt;&lt;P&gt;Please note that the variable is not defined in Qlikview, rather it is local to the macro script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;set chart = ActiveDocument.Activesheet.CreateStraightTable&lt;/P&gt;&lt;P&gt;chart.AddDimension "Product"&lt;/P&gt;&lt;P&gt;chart.AddExpression "sum(Amount)"&lt;/P&gt;&lt;P&gt;The above works fine, but if I want the dimensions and Expressions to be stored in a variable, it is causing issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim testDimension,testExpression&lt;/P&gt;&lt;P&gt;set testDimension="Product" '(In the actual solution these will be fetched from the config file on the fly)&lt;/P&gt;&lt;P&gt;set testExpression= "sum(Amount)"&lt;/P&gt;&lt;P&gt;set chart = ActiveDocument.Activesheet.CreateStraightTable&lt;/P&gt;&lt;P&gt;chart.AddDimension testDimension&lt;/P&gt;&lt;P&gt;chart.AddExpression testExpression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know a way to read the variables as Dimensions and Expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Nidhi&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 12pt; font-family: Calibri;"&gt;&lt;SPAN lang=""&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:59:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Dynamic-Dimension-using-local-variable-in-a-macro/m-p/1395885#M423756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-13T09:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Dynamic Dimension using local variable in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Dynamic-Dimension-using-local-variable-in-a-macro/m-p/1395886#M423757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These dimensions/expressions variables contain only strings and are no objects and should be therefore not declared with "set". I'm not sure if Qlik needs here the double-quotes arounds the variable but you could try it if it's not working so far with: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;chart.AddDimension chr(34) &amp;amp; testDimension &amp;amp; chr(34)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Macus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2017 16:51:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Dynamic-Dimension-using-local-variable-in-a-macro/m-p/1395886#M423757</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-12-13T16:51:27Z</dc:date>
    </item>
  </channel>
</rss>

