<?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 Return value of RemoveExpression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357788#M576794</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;I can´t assign the returns to a variable.&lt;/P&gt;&lt;P&gt;If you want remove all expressions you must use &lt;STRONG&gt;&lt;EM&gt;chart.RemoveExpression all&lt;/EM&gt;&lt;/STRONG&gt; but I think you already know that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set chart = ActiveDocument.GetSheetObject("CH01")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set cp = chart.GetProperties&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;x = cp.Expressions.Item(0).Count&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could count the number of expressions of each chart before remove all of them and use the sentence to remove all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chart.RemoveExpression all&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;Chema&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 16:53:47 GMT</pubDate>
    <dc:creator>chematos</dc:creator>
    <dc:date>2012-04-18T16:53:47Z</dc:date>
    <item>
      <title>Return value of RemoveExpression</title>
      <link>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357787#M576793</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 need to delete all Expressions of a chart in module. In API Guide, is documented that &lt;SPAN style="color: #0000ff;"&gt;RemoveExpression &lt;/SPAN&gt;returns the number of remaining Expressions in chart. I Use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;SET chart = ActiveDocument.GetSheetObject("CH01")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;n =&amp;nbsp; chart.RemoveExpression 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this dosn't work. When i write the second line like bellow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;chart.RemoveExpression 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modul runs without problem. But the number of remaining Expressions is very important for me.&lt;/P&gt;&lt;P&gt;I will appreciate every idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Peyman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 16:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357787#M576793</guid>
      <dc:creator>azimabadi</dc:creator>
      <dc:date>2012-04-18T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Return value of RemoveExpression</title>
      <link>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357788#M576794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;I can´t assign the returns to a variable.&lt;/P&gt;&lt;P&gt;If you want remove all expressions you must use &lt;STRONG&gt;&lt;EM&gt;chart.RemoveExpression all&lt;/EM&gt;&lt;/STRONG&gt; but I think you already know that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set chart = ActiveDocument.GetSheetObject("CH01")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set cp = chart.GetProperties&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;x = cp.Expressions.Item(0).Count&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could count the number of expressions of each chart before remove all of them and use the sentence to remove all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chart.RemoveExpression all&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;Chema&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 16:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357788#M576794</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-04-18T16:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of RemoveExpression</title>
      <link>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357789#M576795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Chema,&lt;/P&gt;&lt;P&gt;but "&lt;SPAN style="color: #ff0000;"&gt;cp.Expressions.Item(0).Count&lt;/SPAN&gt;" returns the number of subexpressions of first expression and "&lt;SPAN style="color: #ff0000;"&gt;RemoveExpression all&lt;/SPAN&gt;" is like "&lt;SPAN style="color: #008000;"&gt;RemoveExpression 0&lt;/SPAN&gt;". I think "&lt;SPAN style="color: #ff0000;"&gt;all&lt;/SPAN&gt;" is interprated as a variable with "&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;" value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tryed many ways and finally found out that the code belows has the correct result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SET chart = ActiveDocument.GetSheetObject("CH01")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SET cp&amp;nbsp;&amp;nbsp;&amp;nbsp; = chart.Getproperties&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;exprCount = cp.Expressions.Count&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FOR i = 1 TO exprCount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chart.RemoveExpression 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 20:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-value-of-RemoveExpression/m-p/357789#M576795</guid>
      <dc:creator>azimabadi</dc:creator>
      <dc:date>2012-04-18T20:29:44Z</dc:date>
    </item>
  </channel>
</rss>

