<?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 Help me with this aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-me-with-this-aggregation/m-p/153110#M30282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this expression below 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;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;(sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&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;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;if(Tax&amp;lt;&amp;gt;0,((sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100),0)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&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;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Aug 2009 20:01:23 GMT</pubDate>
    <dc:creator>rcandeo</dc:creator>
    <dc:date>2009-08-10T20:01:23Z</dc:date>
    <item>
      <title>Help me with this aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Help-me-with-this-aggregation/m-p/153110#M30282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this expression below 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;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;(sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&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;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;if(Tax&amp;lt;&amp;gt;0,((sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100),0)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&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;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2009 20:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-me-with-this-aggregation/m-p/153110#M30282</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2009-08-10T20:01:23Z</dc:date>
    </item>
  </channel>
</rss>

