<?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 Count unique values from a CrossTable() column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-unique-values-from-a-CrossTable-column/m-p/1513241#M599664</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;The question is part of the&amp;nbsp;discussion posted on the below link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Community/Calculate-distinct-values-from-rows-based-on-multiple-dimension/m-p/1511997#M6815" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Community/Calculate-distinct-values-from-rows-based-on-multiple-dimension/m-p/1511997#M6815&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the count of unique values from a CrossTable column.&lt;/P&gt;&lt;P&gt;The answer provided by Jontydkpi&lt;SPAN class="login-bold"&gt;&amp;nbsp;is correct and works for the attached data set under the above post. However, when I apply the method on my actual data set, it does not give the unique number of&amp;nbsp; count.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Consider the below sample data record for your reference,&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;STAFF 1&lt;/TD&gt;&lt;TD&gt;STAFF 2&lt;/TD&gt;&lt;TD&gt;STAFF 3&lt;/TD&gt;&lt;TD&gt;STAFF 4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Millar, Patrick&lt;/TD&gt;&lt;TD&gt;Cooper, David (Assistant 1)&lt;/TD&gt;&lt;TD&gt;Millar, Patrick (Manager)&lt;/TD&gt;&lt;TD&gt;Mills, Peter (Assistant Coordinator)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the concern I got is the&amp;nbsp; "comma" (",") which separates the first name and the last name.&lt;/P&gt;&lt;P&gt;The expected outcome from the above row should be 3 Staff Members ( cos the STAFF 1 and STAFF 3 referred to the same member) instead of 4. Sometimes a staff member could have only his/her name(filed &lt;SPAN&gt;STAFF&amp;nbsp;&lt;/SPAN&gt;1) or the name followed by the designation(filed &lt;SPAN&gt;STAFF&amp;nbsp;&lt;/SPAN&gt;3).&amp;nbsp; Thus, the retrieving of the unique staff number should consider&amp;nbsp; name on the Field STAFF 1 against the any other field which got the Staff names.&lt;/P&gt;&lt;P&gt;I use the CrossTable() function and the below code to calculate the unique Staff Numbers&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField([Staff 1], ' ', 1) as [Staff 1],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above returns an answer of 4 Staff instead of 3.&lt;/P&gt;&lt;P&gt;I may be missing here. But really appreciate, if some one (may be &lt;SPAN&gt;Jontydkpi&lt;/SPAN&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;or Tresesco) could help me to fix this issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2018 03:01:16 GMT</pubDate>
    <dc:creator>andymanu</dc:creator>
    <dc:date>2018-11-28T03:01:16Z</dc:date>
    <item>
      <title>Count unique values from a CrossTable() column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-values-from-a-CrossTable-column/m-p/1513241#M599664</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;The question is part of the&amp;nbsp;discussion posted on the below link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Community/Calculate-distinct-values-from-rows-based-on-multiple-dimension/m-p/1511997#M6815" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Community/Calculate-distinct-values-from-rows-based-on-multiple-dimension/m-p/1511997#M6815&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the count of unique values from a CrossTable column.&lt;/P&gt;&lt;P&gt;The answer provided by Jontydkpi&lt;SPAN class="login-bold"&gt;&amp;nbsp;is correct and works for the attached data set under the above post. However, when I apply the method on my actual data set, it does not give the unique number of&amp;nbsp; count.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Consider the below sample data record for your reference,&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;STAFF 1&lt;/TD&gt;&lt;TD&gt;STAFF 2&lt;/TD&gt;&lt;TD&gt;STAFF 3&lt;/TD&gt;&lt;TD&gt;STAFF 4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Millar, Patrick&lt;/TD&gt;&lt;TD&gt;Cooper, David (Assistant 1)&lt;/TD&gt;&lt;TD&gt;Millar, Patrick (Manager)&lt;/TD&gt;&lt;TD&gt;Mills, Peter (Assistant Coordinator)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the concern I got is the&amp;nbsp; "comma" (",") which separates the first name and the last name.&lt;/P&gt;&lt;P&gt;The expected outcome from the above row should be 3 Staff Members ( cos the STAFF 1 and STAFF 3 referred to the same member) instead of 4. Sometimes a staff member could have only his/her name(filed &lt;SPAN&gt;STAFF&amp;nbsp;&lt;/SPAN&gt;1) or the name followed by the designation(filed &lt;SPAN&gt;STAFF&amp;nbsp;&lt;/SPAN&gt;3).&amp;nbsp; Thus, the retrieving of the unique staff number should consider&amp;nbsp; name on the Field STAFF 1 against the any other field which got the Staff names.&lt;/P&gt;&lt;P&gt;I use the CrossTable() function and the below code to calculate the unique Staff Numbers&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField([Staff 1], ' ', 1) as [Staff 1],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above returns an answer of 4 Staff instead of 3.&lt;/P&gt;&lt;P&gt;I may be missing here. But really appreciate, if some one (may be &lt;SPAN&gt;Jontydkpi&lt;/SPAN&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;or Tresesco) could help me to fix this issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 03:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-values-from-a-CrossTable-column/m-p/1513241#M599664</guid>
      <dc:creator>andymanu</dc:creator>
      <dc:date>2018-11-28T03:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count unique values from a CrossTable() column</title>
      <link>https://community.qlik.com/t5/QlikView/Count-unique-values-from-a-CrossTable-column/m-p/1513284#M599665</link>
      <description>Hi All,&lt;BR /&gt;I think I got the answer for the above question after playing around the code.&lt;BR /&gt;I simply changed the "SubField([Staff 1], ' ', 1) as [Staff 1]," statement to "SubField([Staff 1], ' (', 1) as [Staff 1], by adding a "(" so that the qlik will not consider anything after the "(" opening bracket.&lt;BR /&gt;Not sure whether this is an efficient way of doing the task, but it worked.&lt;BR /&gt;Thanks.&lt;BR /&gt;Kind regards,&lt;BR /&gt;Andy</description>
      <pubDate>Wed, 28 Nov 2018 05:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-unique-values-from-a-CrossTable-column/m-p/1513284#M599665</guid>
      <dc:creator>andymanu</dc:creator>
      <dc:date>2018-11-28T05:46:38Z</dc:date>
    </item>
  </channel>
</rss>

