<?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 unique value based on min and max on another column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251585#M849613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this for P-P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Count(DISTINCT {$&amp;lt;cb_telno = {"=FirstSortedValue(cb_score, Date) = 1 and FirstSortedValue(cb_score, -Date) = 1"}&amp;gt;} cb_telno)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 15:30:46 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-03-21T15:30:46Z</dc:date>
    <item>
      <title>Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251584#M849612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to do an analysis on my Customer NPS Trend, I wonder if it's possible to count how many customer which follow this trend based on min date and max date. For example:&lt;/P&gt;&lt;P&gt;Promoter to Promoter trend:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="P-P.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/156958_P-P.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Based the first date (3/1/2017) the cb_score is 1 and I compare with the last date (3/11/2017). I want to count unique cb_telno.&lt;/P&gt;&lt;P&gt;Another example is Promoter to Detractor. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="P-D.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/156965_P-D.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Based the first date (3/6/2017) the cb_score is 1 and I compare with the last date (3/8/2017) which the cb_score is -1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Here's how the whole data look like: &lt;IMG alt="wholedata.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/156966_wholedata.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;And I want the final result to look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;IMG alt="final-result.PNG" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/156967_final-result.PNG" style="max-width: 620px; height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I only count for cb_telno which have more than 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I've tried to use this expression for Promoter to Promoter but it seems the min max Date would not work.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt; Count(DISTINCT {$&amp;lt;Date = {"$(=min(Date))"},cb_score = {'1'}&amp;gt; *&lt;/P&gt;
&lt;P&gt; $&amp;lt;Date = {"$(=max(Date))"},cb_score = {'1'}&amp;gt;} cb_telno)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would greatly appreciate any help that anyone can give me in solving this. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251584#M849612</guid>
      <dc:creator>edzreeayub</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251585#M849613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this for P-P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Count(DISTINCT {$&amp;lt;cb_telno = {"=FirstSortedValue(cb_score, Date) = 1 and FirstSortedValue(cb_score, -Date) = 1"}&amp;gt;} cb_telno)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:30:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251585#M849613</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-21T15:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251586#M849614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Edzree Ayub wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to do an analysis on my Customer NPS Trend, I wonder if it's possible to count how many customer which follow this trend based on min date and max date. For example:&lt;/P&gt;
&lt;P&gt;Promoter to Promoter trend:&lt;/P&gt;
&lt;P&gt;&lt;IMG alt="P-P.PNG" class="jive-image image-1" height="86" src="https://community.qlik.com/legacyfs/online/156982_P-P.PNG" style="height: auto;" width="560" /&gt;&lt;/P&gt;
&lt;P&gt;Based the first date (3/1/2017) the cb_score is 1 and I compare with the last date (3/11/2017). I want to count unique cb_telno.&lt;/P&gt;
&lt;P&gt;Another example is Promoter to Detractor.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count({&amp;lt;_%wscKey = {'$(=Max(_%wscKey))'}&amp;gt;}Distinct cb_telno)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251586#M849614</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-03-21T15:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251587#M849615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Count({&amp;lt;_%wscKey = {'$(=Max(SubField(_%wscKey,-1)))'}&amp;gt;}Distinct cb_telno)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251587#M849615</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-03-21T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251588#M849616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or may be add the Count() condition also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {$&amp;lt;cb_telno = {"=FirstSortedValue(cb_score, Date) = 1 and FirstSortedValue(cb_score, -Date) = 1 and Count(cb_telno) &amp;gt; 1"}&amp;gt;} cb_telno)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:38:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251588#M849616</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-21T15:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique value based on min and max on another column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251589#M849617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny. This works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 02:13:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-value-based-on-min-and-max-on-another-column/m-p/1251589#M849617</guid>
      <dc:creator>edzreeayub</dc:creator>
      <dc:date>2017-03-22T02:13:32Z</dc:date>
    </item>
  </channel>
</rss>

