<?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: Script error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476888#M1145174</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 seems that the problem are the if - clauses.&amp;nbsp; You can try it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month as Monthall, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RegionName as Region,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',PricePaid/Weight,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as OverallPPG,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',Weight,0) as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalVolume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; avg(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',ActSpotPrice,0) as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSpotPrice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident OverallTable&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;group by Month, RegionName,TransactionType,CancelledDate; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Aug 2013 12:28:58 GMT</pubDate>
    <dc:creator>mseeck75</dc:creator>
    <dc:date>2013-08-08T12:28:58Z</dc:date>
    <item>
      <title>Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476884#M1145170</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;&lt;/P&gt;&lt;P&gt;New to QV here and learning quickely, however, I have inherited a project which has a a tab within the script which has the following code and fails; any ideas whats wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Field names are correct and the tab is titled "optimise for Calc", other tabs are "Main" &amp;amp; "QVD Load" both work fine when stepped through debug..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt; Month as Monthall,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RegionName as Region,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',sum(PricePaid)/sum(Weight)) as OverallPPG,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',sum(Weight)) as TotalVolume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',avg(ActSpotPrice)) as TotalSpotPrice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident OverallTable&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;group by Month, RegionName,TransactionType,CancelledDate; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 11:53:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476884#M1145170</guid>
      <dc:creator>pauledrich</dc:creator>
      <dc:date>2013-08-08T11:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476885#M1145171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could you give a screenshot of the error you encountered?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it looks that you are using aggregation function without &lt;/P&gt;&lt;P&gt;a "Group By" clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 11:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476885#M1145171</guid>
      <dc:creator>anandathome</dc:creator>
      <dc:date>2013-08-08T11:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476886#M1145172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, When running the debug the pop up window is:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table not found&lt;/P&gt;&lt;P&gt;Load Month as Monthall,&lt;/P&gt;&lt;P&gt;RegionName as Region,&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',sum(PricePaid)/sum(Weight)) as OverallPPG,&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',sum(Weight)) as TotalVolume,&lt;/P&gt;&lt;P&gt;if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',avg(ActSpotPrice)) as TotalSpotPrice&lt;/P&gt;&lt;P&gt;Resident OverallTable&lt;/P&gt;&lt;P&gt;group by Month, RegionName,TransactionType,CancelledDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 12:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476886#M1145172</guid>
      <dc:creator>pauledrich</dc:creator>
      <dc:date>2013-08-08T12:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476887#M1145173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this table OverallTable, i think you drop this table.&lt;/P&gt;&lt;P&gt;and then remove group by in your code, because group by work with aggrigate function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 12:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476887#M1145173</guid>
      <dc:creator />
      <dc:date>2013-08-08T12:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476888#M1145174</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 seems that the problem are the if - clauses.&amp;nbsp; You can try it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month as Monthall, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RegionName as Region,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',PricePaid/Weight,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as OverallPPG,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',Weight,0) as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalVolume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; avg(if(isnull(CancelledDate)and RegionName&amp;lt;&amp;gt;'Unallocated' and TransactionType='C',ActSpotPrice,0) as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSpotPrice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident OverallTable&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;group by Month, RegionName,TransactionType,CancelledDate; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 12:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476888#M1145174</guid>
      <dc:creator>mseeck75</dc:creator>
      <dc:date>2013-08-08T12:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-error/m-p/476889#M1145175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seesms that 'OverallTable' table is not there in the script prior to this section of code. And there is no need to remove 'Group By', else your AVG() (an aggregation function) would not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 12:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-error/m-p/476889#M1145175</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-08T12:41:53Z</dc:date>
    </item>
  </channel>
</rss>

