<?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: count with FirstSortedValue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231160#M392301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem my friend, I am glad I have been able to help you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Dec 2016 15:10:27 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-08T15:10:27Z</dc:date>
    <item>
      <title>count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231153#M392294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;currently I stuck in a question witch is more ore less already discussed within the forum.&lt;/P&gt;&lt;P&gt;But unfortunately I don't find the right solution or maybe I don't understand to use the already provided solutions with my data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to calculate the number of unique values and the percentage for my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data includes two tables, one table with unique customers and one with different datasets to each customer with different values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%ID, Name, AREA, Criteria&lt;BR /&gt; 1, ABC, 01, B&lt;BR /&gt; 2, BCD, 01, A&lt;BR /&gt; ...&lt;BR /&gt; &lt;BR /&gt; DATA:&lt;BR /&gt; ID_Data, %ID, DATE, value1, value2&lt;BR /&gt; 1, 1, 25.11.2016, yes, no&lt;BR /&gt; 2, 2, 30.10.2016, no, yes&lt;BR /&gt; 3, 2, 02.11.2016, yes, yes&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The both tables are linked by the Key %ID .&lt;/P&gt;&lt;P&gt;I have already a table in which both tables are linked and the output is a list of customers with the last value and date for each value.&lt;IMG __jive_id="146040" alt="table.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146040_table.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to calculate the number of values from the data table for each customer witch has the criteria A or B.&lt;BR /&gt;And in a second formula I try to calculate the percentage of the values. --&amp;gt; Here I'm not able to calculate the complete sum of A and B per value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="146041" alt="table2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/146041_table2.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope, I could explain my questions understandable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance for your support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Claus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231153#M392294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231154#M392295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231154#M392295</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-08T14:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231155#M392296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks again Sunny!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculation of the percentage works by this formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&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: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&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: #0000ff; font-size: 8pt;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;value1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=Len(Trim(value1)) &amp;gt; 0"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'A', 'B'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;value1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, -&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 1, 0), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AREA&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt; /&lt;BR /&gt; &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: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&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: #0000ff; font-size: 8pt;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;value1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=Len(Trim(value1)) &amp;gt; 0"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'A', 'B'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;value1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, -&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) =&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #800000; font-size: 8pt;"&gt;Dim&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;, 1, 1&lt;/STRONG&gt; ), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AREA&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;STRONG&gt;*2&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if I understand this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Claus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:55:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231155#M392296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T14:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231156#M392297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you not understand?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:58:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231156#M392297</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-08T14:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231157#M392298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The DIM construct and the limitation by = DIM, 1,1&amp;nbsp; and *2 at the end in my percentage calculation.&lt;/P&gt;&lt;P&gt;I'm not sure if there is a smarter solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Claus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231157#M392298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T15:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231158#M392299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the smarter solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(If(FirstSortedValue({&amp;lt;value1 = {"=Len(Trim(value1)) &amp;gt; 0"},&amp;nbsp; Criteria = {'A', 'B'}&amp;gt;} value1, -DATE) = Dim, 1, 0), AREA, Name, Criteria, Dim))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(&lt;SPAN style="color: #ff0000;"&gt;TOTAL&lt;/SPAN&gt; Aggr(If(FirstSortedValue({&amp;lt;value1 = {"=Len(Trim(value1)) &amp;gt; 0"},&amp;nbsp; Criteria = {'A', 'B'}&amp;gt;} value1, -DATE) = Dim, 1, 0), AREA, Name, Criteria, Dim))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:06:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231158#M392299</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-08T15:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231159#M392300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect! Many thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:08:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231159#M392300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T15:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: count with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231160#M392301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem my friend, I am glad I have been able to help you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-with-FirstSortedValue/m-p/1231160#M392301</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-08T15:10:27Z</dc:date>
    </item>
  </channel>
</rss>

