<?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 Doubt with and aggregate expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Doubt-with-and-aggregate-expression/m-p/151667#M29404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this expression above that works in all lines, but in the line total, if there is any line with zero value, it returns an invalid value (-).&lt;/P&gt;&lt;P&gt;(sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100&lt;/P&gt;&lt;P&gt;I´ve made a comparison testing if tax is zero, but it didn't work anyway.&lt;/P&gt;&lt;P&gt;if(Tax&amp;lt;&amp;gt;0,((sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100),0)&lt;/P&gt;&lt;P&gt;Anyone can give a hint to solve my problem?&lt;/P&gt;&lt;P&gt;For information:&lt;/P&gt;&lt;P&gt;I have in my table the amount for document and I need to find out the tax value. I am using an aggregate expression cause I have the amount of the document in all lines (a document can have n lines), and if I don't do this aggregate, It'll multiply the tax value by the lines of the document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Aug 2009 00:44:34 GMT</pubDate>
    <dc:creator>rcandeo</dc:creator>
    <dc:date>2009-08-08T00:44:34Z</dc:date>
    <item>
      <title>Doubt with and aggregate expression</title>
      <link>https://community.qlik.com/t5/QlikView/Doubt-with-and-aggregate-expression/m-p/151667#M29404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this expression above that works in all lines, but in the line total, if there is any line with zero value, it returns an invalid value (-).&lt;/P&gt;&lt;P&gt;(sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100&lt;/P&gt;&lt;P&gt;I´ve made a comparison testing if tax is zero, but it didn't work anyway.&lt;/P&gt;&lt;P&gt;if(Tax&amp;lt;&amp;gt;0,((sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100),0)&lt;/P&gt;&lt;P&gt;Anyone can give a hint to solve my problem?&lt;/P&gt;&lt;P&gt;For information:&lt;/P&gt;&lt;P&gt;I have in my table the amount for document and I need to find out the tax value. I am using an aggregate expression cause I have the amount of the document in all lines (a document can have n lines), and if I don't do this aggregate, It'll multiply the tax value by the lines of the document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Aug 2009 00:44:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Doubt-with-and-aggregate-expression/m-p/151667#M29404</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2009-08-08T00:44:34Z</dc:date>
    </item>
  </channel>
</rss>

