<?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 Error in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148702#M26956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No back ground color is set , please find code as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;sub&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabel&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;s=ActiveDocument.Sheets("SH02" &lt;P&gt;)&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;for&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i=0 to orignumber-1&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;next&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Hlo=ActiveDocument.GetSheet("SH02" &lt;P&gt;).CreatePivotTable&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;arrslc=ActiveDocument.Fields("$Field" &lt;P&gt;).GetSelectedValues(200)&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;for&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i=0 to arrslc.Count-1&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;if&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;slc&amp;lt;&amp;gt;"AutoID" &lt;P style="font-weight: bold"&gt;then&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;if&lt;/P&gt;&lt;P style="font-weight: bold"&gt;next&lt;/P&gt;&lt;P&gt;"sum(if(ValidTo&amp;gt;=[DateFrom] and ValidTo&amp;lt;=[DateTo],(if([Variable1]='BPARate',BPARate,if([Variable1]='BAF',BAF,if([Variable1]='CAF',CAF))))))"&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cp = Hlo.GetProperties&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expr = cp.Expressions.Item(0).Item(0).Data.ExpressionVisual&lt;/P&gt;&lt;P&gt;"BPARate"&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prop = Hlo.GetProperties&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;true&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;end&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;sub&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jul 2009 17:17:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-07T17:17:36Z</dc:date>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148698#M26952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a pivot table through a macro after making some selections which act as the dimensions.&lt;/P&gt;&lt;P&gt;The macro works fine when run on the server but when trying to run on IE, the pivot table is created but it is all black in color making it unreadable, even if i send it to excel, the font and the background color is black&lt;/P&gt;&lt;P&gt;Unable to resolve this issue&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 15:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148698#M26952</guid>
      <dc:creator />
      <dc:date>2009-07-07T15:41:20Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148699#M26953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;Are you dynamically setting the background colour? I had something similar recently and as none of the conditions were true QV defaulted it to black. To test if the values are actually there change the fill colour to none for the cells in the exported spreadsheet (if the text colour is black then they are simply being hidden).&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 16:33:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148699#M26953</guid>
      <dc:creator />
      <dc:date>2009-07-07T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148700#M26954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gordon&lt;/P&gt;&lt;P&gt;Yes there is data in the table but since both the background and the text color is black, it is not readable&lt;/P&gt;&lt;P&gt;Please suggext a way where we can change the qv default from black to white&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 16:39:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148700#M26954</guid>
      <dc:creator />
      <dc:date>2009-07-07T16:39:35Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148701#M26955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So are you setting the background colour? If you are it sounds like the conditioning is wrong (no colour is being returned) If you want to post the conditioning....&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 17:01:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148701#M26955</guid>
      <dc:creator />
      <dc:date>2009-07-07T17:01:46Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148702#M26956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No back ground color is set , please find code as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;sub&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabel&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;s=ActiveDocument.Sheets("SH02" &lt;P&gt;)&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;for&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i=0 to orignumber-1&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;next&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Hlo=ActiveDocument.GetSheet("SH02" &lt;P&gt;).CreatePivotTable&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;arrslc=ActiveDocument.Fields("$Field" &lt;P&gt;).GetSelectedValues(200)&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;for&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i=0 to arrslc.Count-1&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;if&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;slc&amp;lt;&amp;gt;"AutoID" &lt;P style="font-weight: bold"&gt;then&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;if&lt;/P&gt;&lt;P style="font-weight: bold"&gt;next&lt;/P&gt;&lt;P&gt;"sum(if(ValidTo&amp;gt;=[DateFrom] and ValidTo&amp;lt;=[DateTo],(if([Variable1]='BPARate',BPARate,if([Variable1]='BAF',BAF,if([Variable1]='CAF',CAF))))))"&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cp = Hlo.GetProperties&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expr = cp.Expressions.Item(0).Item(0).Data.ExpressionVisual&lt;/P&gt;&lt;P&gt;"BPARate"&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prop = Hlo.GetProperties&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;true&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;end&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;sub&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 17:17:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148702#M26956</guid>
      <dc:creator />
      <dc:date>2009-07-07T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148703#M26957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest you explicitly set the background colour to white - see BkgColor and BkgColorExp in the API guide.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 17:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148703#M26957</guid>
      <dc:creator />
      <dc:date>2009-07-07T17:27:30Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148704#M26958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;Tried using the same but error still persists&lt;/P&gt;&lt;P&gt;Can you send me an example or code ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 11:13:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148704#M26958</guid>
      <dc:creator />
      <dc:date>2009-07-08T11:13:58Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148705#M26959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The API guide should show examples, but here is some code I wrote a while ago which you are welcome to pick over. It creates a straight table with dynamic expressions based on the entries in a tablebox and sets the background color based on a numeric entry in the tablebox.&lt;/P&gt;&lt;P&gt;sub CH_TOTALS_Expr&lt;BR /&gt;' Set the expressions for the current repairs&lt;/P&gt;&lt;P&gt;set chart = ActiveDocument.GetSheetObject("CH_TOTALS")&lt;BR /&gt; set cp = chart.GetProperties&lt;/P&gt;&lt;P&gt;' remove all existing expressions from chart&lt;BR /&gt; n = cp.Expressions.Count&lt;BR /&gt; Do While n &amp;gt; 0 ' will end when no more expressions or unxepected error from removeexpression&lt;BR /&gt; n = chart.RemoveExpression(0)&lt;BR /&gt; Loop&lt;/P&gt;&lt;P&gt;' add expression for every repair&lt;BR /&gt; set tbox = ActiveDocument.GetSheetObject( "TB_HEADERS" )&lt;BR /&gt; For r = 1 to tbox.GetRowCount-1 ' rows numbered from 0 but skip table box header row&lt;BR /&gt; set cell = tbox.GetCell(r,2) ' get RBF Code&lt;BR /&gt; chart.AddExpression "sum(if ([RBF Code]='" &amp;amp; cell.Text &amp;amp; "', [Reqd Qty], 0))"&lt;BR /&gt; Next 'r&lt;/P&gt;&lt;P&gt;' now set the corresponding repair description as the column label and the background colour to the group number&lt;BR /&gt; ' have to do this as a second loop as after adding an expression would otherwise need to 'GetProperties' each time&lt;BR /&gt; set cp = chart.GetProperties&lt;BR /&gt; For r = 1 to tbox.GetRowCount-1 ' rows numbered from 0 but skip table box header row&lt;BR /&gt; set expr = cp.Expressions.Item(r -1).Item(0).Data 'expressions numbered from 0&lt;BR /&gt; set cell = tbox.GetCell(r,3) ' get Repair&lt;BR /&gt; set ev = expr.ExpressionVisual&lt;BR /&gt; ev.Label.v = cell.Text&lt;BR /&gt; ev.ColWidth = 265&lt;BR /&gt; set cell = tbox.GetCell(r,0) ' get Group No&lt;BR /&gt; set bce = expr.AttributeExpressions.BkgColorExp&lt;BR /&gt; bce.Definition.v = "color(" &amp;amp; cell.Text &amp;amp; ")"&lt;BR /&gt; Next 'r&lt;BR /&gt;&lt;BR /&gt; cp.TableProperties.StyleNumber = -1 ' set style to 'custom'&lt;BR /&gt;&lt;BR /&gt; chart.SetProperties cp&lt;/P&gt;&lt;P&gt;ActiveDocument.Save&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;What happens though after your table is created and you change the background colour manually?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 15:39:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148705#M26959</guid>
      <dc:creator />
      <dc:date>2009-07-08T15:39:32Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148706#M26960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;I have sorted out the problem&lt;/P&gt;&lt;P&gt;Now instead of creating a new pivot table, i am removing the existing fields and adding new fields in already existing Pivot table, this is working fine&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 16:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148706#M26960</guid>
      <dc:creator />
      <dc:date>2009-07-08T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148707#M26961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I intend to create the same kind of "dynamic" pivot table with a macro to modify dimensions and expressions but i read in the QlikView manual that interaction with objects (using SetProperties for instance) is not allowed as soon as QlikView server is used...&lt;/P&gt;&lt;P&gt;But it seems you implemented it and tested with server. Is this working fine?&lt;/P&gt;&lt;P&gt;Thanks in advance for your feedback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 15:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148707#M26961</guid>
      <dc:creator />
      <dc:date>2010-02-22T15:37:51Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148708#M26962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are absolutely right - the manual DOES say you should avoid changing the properties of objects in macros when running the document with QV Server. However, everyone does it and I am not aware of it ever causing any problems.&lt;/P&gt;&lt;P&gt;Having said that, I avoid it whenever possible and indeed you should also avoid macros too if possible (for example create multiple objects where only one is displayed using display conditioning based on variables rather than changing properties).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 15:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148708#M26962</guid>
      <dc:creator />
      <dc:date>2010-02-22T15:48:04Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148709#M26963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's interesting... Thank you very much for this answer. I'll rely on you for this "everyone does it" then.&lt;/P&gt;&lt;P&gt;I understand macros should be avoided in order to keep things simple mainly. But official point of view is really scarry as if macros can't be stable or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 16:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148709#M26963</guid>
      <dc:creator />
      <dc:date>2010-02-22T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148710#M26964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The main reason is that macros cause inefficiencies - caches are cleared and so on as Qlikview cannot know what you are up to with your code. I have attached a document from Qliktech which should give you more details why macros should be avoided if possible.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 16:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148710#M26964</guid>
      <dc:creator />
      <dc:date>2010-02-22T16:20:55Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148711#M26965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am facing on exacly the same problem. I want to build a pivot table depending on the selections, my users made on another sheet. There should be different Buttons, where you can choose, how you pivot table should look like and which dimensions and expressions are used. Perhaps you can help me, to find a solution:&lt;BR /&gt;How do you remove the existing fields and adding new fields in an already existing Pivot table?&lt;BR /&gt;&lt;BR /&gt;Regards, Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 13:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148711#M26965</guid>
      <dc:creator />
      <dc:date>2010-10-08T13:14:00Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148712#M26966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure quite what you're looking for, but attached is one way of adding and removing dimensions and expressions based on user selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Oct 2010 00:21:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148712#M26966</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-10-09T00:21:21Z</dc:date>
    </item>
    <item>
      <title>Error in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148713#M26967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;your example helps me to find a solution for my problem. Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 12:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-Pivot-Table/m-p/148713#M26967</guid>
      <dc:creator />
      <dc:date>2010-10-19T12:14:01Z</dc:date>
    </item>
  </channel>
</rss>

