<?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: set analysis modifier with counts in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198127#M22622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So how do you know that Port C has all the the services? May be, for example, this is what we have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Port A - a, b&lt;/P&gt;&lt;P&gt;Port B - c&lt;/P&gt;&lt;P&gt;Port C - b, c, d, e, f, g, h (Doesn't have a)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is that not possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Oct 2016 19:28:18 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-10-14T19:28:18Z</dc:date>
    <item>
      <title>set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198126#M22621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data which is sites, ports, and services&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A site has multiple ports&lt;/LI&gt;&lt;LI&gt;A port belongs to one site&lt;/LI&gt;&lt;LI&gt;Ports to Services is many to many&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with sites as the dimension.&lt;/P&gt;&lt;P&gt;I want to add a count of the # of ports on that sites that carry all services that cross the site.&lt;/P&gt;&lt;P&gt;So for example,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;if Site Alpha has 4 ports and 6 Services with the following distribution:&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Port A carries 2 services&lt;/LI&gt;&lt;LI&gt;Port B carries 1 service&lt;/LI&gt;&lt;LI&gt;Port C carries 6 services&lt;/LI&gt;&lt;LI&gt;Port D carries1 service&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;My table should report:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;Site A&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;(counting only Port C)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following to count ports with a hard-coded number of services:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count (distinct {$&amp;lt;[port]= {"=count( distinct [service]) = 6"}&amp;gt;} [port])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am stuck trying to replace the hard-coded "6" with a count of the total number of services on the site for the specific row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help you can provide!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 19:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198126#M22621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-14T19:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198127#M22622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So how do you know that Port C has all the the services? May be, for example, this is what we have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Port A - a, b&lt;/P&gt;&lt;P&gt;Port B - c&lt;/P&gt;&lt;P&gt;Port C - b, c, d, e, f, g, h (Doesn't have a)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is that not possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 19:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198127#M22622</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-14T19:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198128#M22623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the set up at the beginning, I specified that Site A has 4 ports and 6 services. In your example, the site would have to have 8 services (I think you meant to put 7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could add a measure to my table of count(distinct [service]) and it will return 6 in my example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 20:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198128#M22623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-14T20:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198129#M22624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So in total there can ever be 6 services? If that is true, what is the issue in hard-coding 6? I mean unless it can change, what is the issue in hard-coding?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 20:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198129#M22624</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-14T20:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198130#M22625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I guess I wasn't very clear. That was just meant to be one example with one site. I used a hard coded value because I was trying to figure out the expression one piece at a time. The actual data has thousands of sites with a variable number of services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me expand my example:&lt;/P&gt;&lt;P&gt;Site A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 1 has services: a,b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 2 has services: c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 3 has services: a, b, c, d, e, f&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 4 has services: e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Site B&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 1 has services: a, b, c&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 2 has services: b, d&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port 3 has services: a, c, d&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;My Table should look like this (I've added an extra column)&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Site ID&lt;/TD&gt;&lt;TD&gt;Total # Services&lt;/TD&gt;&lt;TD&gt;# Ports with all services&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Site A&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Site B&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the total number of services column using &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;count(distinct [service])&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I just have not been able to use this within the modifier for the # of Ports column to get the total number of services per site:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count (distinct {$&amp;lt;[port]= {"=count( distinct [service]) = &lt;STRONG&gt;6&lt;/STRONG&gt;"}&amp;gt;} [port])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Thank you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 20:43:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198130#M22625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-14T20:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198131#M22626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give this a shot:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;=Count(DISTINCT {$&amp;lt;[port]= {"=Count(DISTINCT [service]) = &lt;SPAN style="color: #ff0000;"&gt;Aggr(NODISTINCT Count(DISTINCT service), site)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;"}&amp;gt;} [port])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I making an assumption here, you can tell me that this is not true and we can look for an alternate solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumption: No two site will have a common port. For instance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Site1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ports - a, b, c, d&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Site2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ports - e, f, g, h (this site won't have any port names which are in Site1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 21:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198131#M22626</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-14T21:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis modifier with counts</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198132#M22627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again, Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 11:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-modifier-with-counts/m-p/1198132#M22627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-18T11:42:20Z</dc:date>
    </item>
  </channel>
</rss>

