<?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: SUM + IF condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SUM-IF-condition/m-p/450667#M485063</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg( aggr( FirstSortedValue(DISTINCT&amp;nbsp; [1. PRELIMINARES], -[FECHA DE ANOTACIÓN]), PAIS, SITE_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your records show multiple entries per site and date (e.g. Site AR01 2 entries on 29/04/2013), so you need to decide how to handle this (when talking about the last annotation date per site). You can try using DISTINCT qualifier with the FirstSortedValue function or maybe using the RecID I introduced in the LOAD script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check attached sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 May 2013 21:47:38 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-05-11T21:47:38Z</dc:date>
    <item>
      <title>SUM + IF condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-IF-condition/m-p/450666#M485062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All Comm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a big problem in here that is taking me upside down&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;...hope some one can help me:&lt;/P&gt;&lt;P&gt;I need to calculate the % of progress of a country with 12 sites (each site has its own progress) therefore the % Progress of the country would be &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(%Country)/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I add the AnnotationDate "factor" is when I have the problem, cause each site can have different AnnotationDates but I only want to take:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " The last AnnotationDate of each Site"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make the %Progress of the Country&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance,&lt;/P&gt;&lt;P&gt;B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 20:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-IF-condition/m-p/450666#M485062</guid>
      <dc:creator />
      <dc:date>2013-05-11T20:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: SUM + IF condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-IF-condition/m-p/450667#M485063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg( aggr( FirstSortedValue(DISTINCT&amp;nbsp; [1. PRELIMINARES], -[FECHA DE ANOTACIÓN]), PAIS, SITE_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your records show multiple entries per site and date (e.g. Site AR01 2 entries on 29/04/2013), so you need to decide how to handle this (when talking about the last annotation date per site). You can try using DISTINCT qualifier with the FirstSortedValue function or maybe using the RecID I introduced in the LOAD script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check attached sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 21:47:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-IF-condition/m-p/450667#M485063</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-11T21:47:38Z</dc:date>
    </item>
  </channel>
</rss>

