<?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: Selection and Without Selection, different count in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953540#M78637</link>
    <description>&lt;P&gt;so your criteria is the slaes PER contract AND customer &amp;gt;0 and not sales per contract.&amp;nbsp; is that rt?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 18:21:40 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2022-07-08T18:21:40Z</dc:date>
    <item>
      <title>Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952827#M78565</link>
      <description>&lt;P&gt;Hi Experts!&lt;/P&gt;
&lt;P&gt;I am facing a peculiar issue in my Qlik Sense app. Due to security concern, can't attach sample file, however will try to explain as much as possible.&lt;/P&gt;
&lt;P&gt;I am trying to find out distinct count of customer id at contract level for sales having non zero values. I am using below expression.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count(distinct&lt;BR /&gt;{&amp;lt;[Customer ID]={"=Sum(Total&amp;lt;[Contract ID], [Customer ID]&amp;gt; [Net Sales])&amp;gt;0"}&amp;gt;} &lt;BR /&gt;total &amp;lt;[Contract ID]&amp;gt; [Customer ID])&lt;/P&gt;
&lt;P&gt;however this expression works well when contract ID is selected but when there is no contract id selection, count shows more which is not correct.&lt;/P&gt;
&lt;P&gt;I have table similar to this.&lt;/P&gt;
&lt;TABLE width="198"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;Contract&lt;/TD&gt;
&lt;TD width="64"&gt;Cust ID&lt;/TD&gt;
&lt;TD width="70"&gt;sales&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;111&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;222&lt;/TD&gt;
&lt;TD&gt;60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;333&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;234&lt;/TD&gt;
&lt;TD&gt;444&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;234&lt;/TD&gt;
&lt;TD&gt;555&lt;/TD&gt;
&lt;TD&gt;80&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any leads will surely of great help, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 12:56:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952827#M78565</guid>
      <dc:creator>Subhasmita</dc:creator>
      <dc:date>2022-07-07T12:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952972#M78587</link>
      <description>&lt;P&gt;try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1657207589562.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83568i09A50E4C8104D892/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1657207589562.png" alt="edwin_0-1657207589562.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;i added a third contract to test sum=0:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_1-1657207627068.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83569i8A292E62ABE2FB53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_1-1657207627068.png" alt="edwin_1-1657207627068.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952972#M78587</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-07-07T15:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952995#M78588</link>
      <description>&lt;P&gt;Thanks for checking on this Edwin!&lt;/P&gt;
&lt;P&gt;I would need the count of customers for the contract which has positive sales. so the example you shared should give me ideally as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="288"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;Contract&lt;/TD&gt;
&lt;TD width="64"&gt;Cust ID&lt;/TD&gt;
&lt;TD width="70"&gt;Prod sales&lt;/TD&gt;
&lt;TD width="90"&gt;Count of Cust&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;333&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;222&lt;/TD&gt;
&lt;TD&gt;60&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;TD&gt;111&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;234&lt;/TD&gt;
&lt;TD&gt;555&lt;/TD&gt;
&lt;TD&gt;80&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;234&lt;/TD&gt;
&lt;TD&gt;444&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;456&lt;/TD&gt;
&lt;TD&gt;500&lt;/TD&gt;
&lt;TD&gt;50&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;456&lt;/TD&gt;
&lt;TD&gt;200&lt;/TD&gt;
&lt;TD&gt;-25&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;456&lt;/TD&gt;
&lt;TD&gt;201&lt;/TD&gt;
&lt;TD&gt;-25&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this expression is giving me correct count when contract is selected but not when contract is not selected and we see contracts on the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count(distinct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&amp;lt;[Customer ID]={"=Sum(Total&amp;lt;[Contract ID], [Customer ID]&amp;gt; [Net Sales])&amp;gt;0"}&amp;gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;total &amp;lt;[Contract ID]&amp;gt; [Customer ID])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1952995#M78588</guid>
      <dc:creator>Subhasmita</dc:creator>
      <dc:date>2022-07-07T16:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953540#M78637</link>
      <description>&lt;P&gt;so your criteria is the slaes PER contract AND customer &amp;gt;0 and not sales per contract.&amp;nbsp; is that rt?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 18:21:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953540#M78637</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-07-08T18:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953546#M78638</link>
      <description>&lt;P&gt;the general solution is the same.&amp;nbsp; using set analysis to find the sum that is &amp;gt; 0.&amp;nbsp; however, this requires a single field so you need to fabricate that field:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1657305817486.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83699i9B0C4FEF02D72625/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1657305817486.png" alt="edwin_0-1657305817486.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;note that i tweaked the data a little as well to test the last contract.&amp;nbsp; cust id 200 will result in 0 total so that should not be included:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_1-1657305889953.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/83700iAE27D4BF140F9049/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_1-1657305889953.png" alt="edwin_1-1657305889953.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;cust 111 is also not included&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 18:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953546#M78638</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-07-08T18:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953660#M78657</link>
      <description>&lt;P&gt;thanks for the solution Edwin! it seems to work with the example data set.&lt;/P&gt;
&lt;P&gt;Unfortunately, i have contract and cust ID coming from different tables, not sure how can i combine them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for looking the problem!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 16:50:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953660#M78657</guid>
      <dc:creator>Subhasmita</dc:creator>
      <dc:date>2022-07-09T16:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Selection and Without Selection, different count</title>
      <link>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953670#M78658</link>
      <description>&lt;P&gt;you dont need to combine tables.&amp;nbsp; it looks like you dont have a proper DM yet which is a different problem from what youve posted.&amp;nbsp; leave them separate and make sure you have a single common key between them.&amp;nbsp; a contract must be with only one customer so cust ID would be your key&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 20:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selection-and-Without-Selection-different-count/m-p/1953670#M78658</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-07-09T20:39:02Z</dc:date>
    </item>
  </channel>
</rss>

