<?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: Removing illogical numbers from an average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380965#M1166344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to embed the conditional into your aggregation (sum) function, not the other way round.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=avg( if([Quality Rating Int]&amp;gt;24, [Quality Rating Int]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use a so called set expression to filter your Ratings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=avg( {&amp;lt;[Quality Rating Int] = {"&amp;gt;24"}&amp;gt;} [Quality Rating Int])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Aug 2012 18:04:46 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-25T18:04:46Z</dc:date>
    <item>
      <title>Removing illogical numbers from an average</title>
      <link>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380964#M1166343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to calculate an average service score for deliveries. The scores are Bad, poor, fair and excellent and have been coverted into 25, 50, 75 or 100 unfortunately in teh conversion process unreported values (of which there are a lot) have been converted to -1 and N/A values have been converted to 0. This is making it very difficult to calculate a correct average. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without having to go back to the programmers and getting them to change something on the load is there a way to exclude these "incorrect" values and get a proper average? I have tried turning them into nulls, but then I get no average at all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I have turning them into 1's but that also throws a weird average&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Quality Rating Int]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;24,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Quality Rating Int]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),1) / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Quality Rating Int]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;24,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NumericCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Quality Rating Int]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I have tried using the rangeavg but that throws "funnys" too&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;rangeAvg &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Service Rating Int]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I am sure there is a really simple way to do this but I can not find it. Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Aug 2012 17:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380964#M1166343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-25T17:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Removing illogical numbers from an average</title>
      <link>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380965#M1166344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to embed the conditional into your aggregation (sum) function, not the other way round.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=avg( if([Quality Rating Int]&amp;gt;24, [Quality Rating Int]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use a so called set expression to filter your Ratings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=avg( {&amp;lt;[Quality Rating Int] = {"&amp;gt;24"}&amp;gt;} [Quality Rating Int])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Aug 2012 18:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380965#M1166344</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-25T18:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Removing illogical numbers from an average</title>
      <link>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380966#M1166345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant, thanks so much for you help. Worked first time perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Aug 2012 09:43:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Removing-illogical-numbers-from-an-average/m-p/380966#M1166345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-26T09:43:16Z</dc:date>
    </item>
  </channel>
</rss>

