<?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 Avg distinct if condition in Water Cooler</title>
    <link>https://community.qlik.com/t5/Water-Cooler/Avg-distinct-if-condition/m-p/1509841#M6210</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am trying to write an script for&amp;nbsp;distinct avg if values are greater then zero its working fine&amp;nbsp;with this statement&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg(DISTINCT(IF(AA&amp;gt;0,AA))AS AA,&lt;/P&gt;&lt;P&gt;below statement is working fine but its including zero when its averaging,how to incorporate greater then zero condition to below statement?&lt;/P&gt;&lt;P&gt;avg(DISTINCT( If(((A * 1) * (B * 1))&amp;gt;0 and (C * 1) * (B * 1) &amp;gt;0, ((C * 1) * (B * 1)) - ((A * 1) * (B * 1)),0))) as COMPCOST&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Tue, 20 Nov 2018 15:02:25 GMT</pubDate>
    <dc:creator>dseelam</dc:creator>
    <dc:date>2018-11-20T15:02:25Z</dc:date>
    <item>
      <title>Avg distinct if condition</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Avg-distinct-if-condition/m-p/1509841#M6210</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am trying to write an script for&amp;nbsp;distinct avg if values are greater then zero its working fine&amp;nbsp;with this statement&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg(DISTINCT(IF(AA&amp;gt;0,AA))AS AA,&lt;/P&gt;&lt;P&gt;below statement is working fine but its including zero when its averaging,how to incorporate greater then zero condition to below statement?&lt;/P&gt;&lt;P&gt;avg(DISTINCT( If(((A * 1) * (B * 1))&amp;gt;0 and (C * 1) * (B * 1) &amp;gt;0, ((C * 1) * (B * 1)) - ((A * 1) * (B * 1)),0))) as COMPCOST&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 15:02:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Avg-distinct-if-condition/m-p/1509841#M6210</guid>
      <dc:creator>dseelam</dc:creator>
      <dc:date>2018-11-20T15:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Avg distinct if condition</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Avg-distinct-if-condition/m-p/1509869#M6216</link>
      <description>&lt;P&gt;May be if you remove , 0 from the end of the if statement&lt;/P&gt;&lt;PRE&gt;avg(DISTINCT( If(((A * 1) * (B * 1))&amp;gt;0 and (C * 1) * (B * 1) &amp;gt;0, ((C * 1) * (B * 1)) - ((A * 1) * (B * 1))&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;,0&lt;/FONT&gt;&lt;/STRIKE&gt;))) as COMPCOST&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 15:26:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Avg-distinct-if-condition/m-p/1509869#M6216</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-20T15:26:53Z</dc:date>
    </item>
  </channel>
</rss>

