<?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: Counting Multiple Fields, potentially count one field multiple times in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1725742#M63979</link>
    <description>&lt;P&gt;if you want to do this in script, One solution :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

load *,subfield(IssueTmp,',') as IssueTmp2;
LOAD *,if([Issue Type]='See Alert Name',[Alert Name],[Issue Type]) as IssueTmp INLINE [
    ID, Alert Name, Issue Type
    1, Danger, A
    2, Warning, See Alert Name
    3, Review, "T,R,Y"
    4, Warning, See Alert Name
    5, Danger, C
    6, Check, N
    7, Review, "F,R"
];

output:


load IssueTmp2 as Error,count(IssueTmp2) as NbrError resident Data group by IssueTmp2;

drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 184px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37073i62C3B9136119755D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 14:32:27 GMT</pubDate>
    <dc:creator>Taoufiq_Zarra</dc:creator>
    <dc:date>2020-07-07T14:32:27Z</dc:date>
    <item>
      <title>Counting Multiple Fields, potentially count one field multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1725725#M63978</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a top 5 table based on a count. My only trouble is, this count needs to be based on two fields, one of which may have comma d-limited data. Similar to the example below:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Alert Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Issue Type&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Danger&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Warning&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;See Alert Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Review&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;T,R,Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Warning&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;See Alert Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Danger&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;6&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Check&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;7&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Review&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;F,R&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output I would expect from here would be:&lt;/P&gt;&lt;P&gt;Warning: 2&lt;/P&gt;&lt;P&gt;R: 2&lt;/P&gt;&lt;P&gt;A: 1&lt;/P&gt;&lt;P&gt;C: 1&lt;/P&gt;&lt;P&gt;N: 1&lt;/P&gt;&lt;P&gt;F: 1&lt;/P&gt;&lt;P&gt;T: 1&lt;/P&gt;&lt;P&gt;Y: 1&lt;/P&gt;&lt;P&gt;I could do this with a bunch of master measures, but I have over 50 unique values. Everything I have tried has come up empty so far.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1725725#M63978</guid>
      <dc:creator>domna</dc:creator>
      <dc:date>2024-11-16T01:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Multiple Fields, potentially count one field multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1725742#M63979</link>
      <description>&lt;P&gt;if you want to do this in script, One solution :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

load *,subfield(IssueTmp,',') as IssueTmp2;
LOAD *,if([Issue Type]='See Alert Name',[Alert Name],[Issue Type]) as IssueTmp INLINE [
    ID, Alert Name, Issue Type
    1, Danger, A
    2, Warning, See Alert Name
    3, Review, "T,R,Y"
    4, Warning, See Alert Name
    5, Danger, C
    6, Check, N
    7, Review, "F,R"
];

output:


load IssueTmp2 as Error,count(IssueTmp2) as NbrError resident Data group by IssueTmp2;

drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 184px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37073i62C3B9136119755D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1725742#M63979</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-07-07T14:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Multiple Fields, potentially count one field multiple times</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1726128#M63980</link>
      <description>&lt;P&gt;Thanks for your answer Taoufiq. Is there any way to do this on the front end with a formula? I'll be passing off this work to a team that really doesn't have any experience using the back end, so it's discouraged for me to hand them solutions in the script.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Multiple-Fields-potentially-count-one-field-multiple/m-p/1726128#M63980</guid>
      <dc:creator>domna</dc:creator>
      <dc:date>2020-07-08T13:50:14Z</dc:date>
    </item>
  </channel>
</rss>

