<?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 AddExpression on 1st position? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708915#M255417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't figure out, how to move (promote, demote) an expression in a chart (Pivot Table) using Macro. The &lt;STRONG&gt;chart.AddExpression&lt;/STRONG&gt; method adds the new expression always at the end (as the last), but in my case I want to add an expression before the existing expressions on 1st position. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method &lt;STRONG&gt;chart.MoveExpression&lt;/STRONG&gt; from, to works only on StraightTableObjects, not pivots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to move the positions of chart expressions?&lt;/P&gt;&lt;P&gt;-Christof&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Oct 2014 06:57:57 GMT</pubDate>
    <dc:creator>ChristofSchwarz</dc:creator>
    <dc:date>2014-10-13T06:57:57Z</dc:date>
    <item>
      <title>Macro AddExpression on 1st position?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708915#M255417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't figure out, how to move (promote, demote) an expression in a chart (Pivot Table) using Macro. The &lt;STRONG&gt;chart.AddExpression&lt;/STRONG&gt; method adds the new expression always at the end (as the last), but in my case I want to add an expression before the existing expressions on 1st position. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method &lt;STRONG&gt;chart.MoveExpression&lt;/STRONG&gt; from, to works only on StraightTableObjects, not pivots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to move the positions of chart expressions?&lt;/P&gt;&lt;P&gt;-Christof&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 06:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708915#M255417</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2014-10-13T06:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro AddExpression on 1st position?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708916#M255418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christof,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use MoveExpression - here an example from APIGuide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rem create new straight table and switch places of expression columns&lt;/P&gt;&lt;P&gt;set chart = ActiveDocument.Sheets("Main").CreateStraightTable&lt;/P&gt;&lt;P&gt;chart.AddDimension "ProductType"&lt;/P&gt;&lt;P&gt;chart.AddExpression "sum(Amount)"&lt;/P&gt;&lt;P&gt;chart.AddExpression "count(Product)"&lt;/P&gt;&lt;P&gt;chart.MoveExpression 1,0&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, 13 Oct 2014 07:18:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708916#M255418</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-10-13T07:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro AddExpression on 1st position?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708917#M255419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, .MoveExpression method exists only in StraightTable objects, Pivots won’t allow it. As a workaround, I added Fast-Chart-Change types (Straight Table, Pivot Table), change the chart type to straight, make the MoveExpression, then change back. This is a bit tricky …&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;-Christof&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 11:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708917#M255419</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2014-10-13T11:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro AddExpression on 1st position?</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708918#M255420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this would be my suggestion for this case then it's quite easy. I think an (worst) alternatively could be to read from the properties all expressions and give them then a new index-number and create the new expression and set the changed properties again ...&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, 13 Oct 2014 11:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-AddExpression-on-1st-position/m-p/708918#M255420</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-10-13T11:20:53Z</dc:date>
    </item>
  </channel>
</rss>

