<?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 Using AND &amp;amp; OR conditions in set analysis to get the total count of unique values across two fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508261#M104474</link>
    <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I have two fields;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;OriginCountryName&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;and&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;FONT color="#000000"&gt; - in the data, these are used to show the origin and destination of a long list of jobs.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;There are 159 unique origin countries&amp;nbsp;and 184 unique destination countries,&amp;nbsp;with&amp;nbsp;191 unique values across the two which I calculated using the below expression:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#3366FF"&gt;count&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;distinct&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;OriginCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;) + (&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;count&lt;/FONT&gt;&lt;FONT color="#000000"&gt;({&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;$&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;-=p(&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;OriginCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;)&amp;gt;}&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;distinct&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#000000"&gt;However, what I am trying to do, is the same thing, but only for jobs where at least one of two fields called &lt;FONT color="#FF9900"&gt;CreditorAccountFF&lt;/FONT&gt; and &lt;FONT color="#FF9900"&gt;DebtorAccountFF&lt;/FONT&gt; is not null. I believe this would be done in set analysis like this:&amp;nbsp;{&amp;lt;&lt;FONT color="#FF9900"&gt;CreditorAccountFF&lt;/FONT&gt; -= {"''"}&amp;gt; + &amp;lt;&lt;FONT color="#FF9900"&gt;DebtorAccountFF&lt;/FONT&gt; -= {"''"}&amp;gt;} - b&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;ut I have just been unable to get it all working in one expression.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Unfortunately I am unable to share any data due to the sensitivity of it, but any suggestions/help would be much appreciated.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 17:13:28 GMT</pubDate>
    <dc:creator>akelleway</dc:creator>
    <dc:date>2025-03-04T17:13:28Z</dc:date>
    <item>
      <title>Using AND &amp; OR conditions in set analysis to get the total count of unique values across two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508261#M104474</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I have two fields;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;OriginCountryName&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;and&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;FONT color="#000000"&gt; - in the data, these are used to show the origin and destination of a long list of jobs.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;There are 159 unique origin countries&amp;nbsp;and 184 unique destination countries,&amp;nbsp;with&amp;nbsp;191 unique values across the two which I calculated using the below expression:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#3366FF"&gt;count&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;distinct&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;OriginCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;) + (&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;count&lt;/FONT&gt;&lt;FONT color="#000000"&gt;({&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;$&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;-=p(&lt;/FONT&gt;&lt;FONT color="#FF9900"&gt;OriginCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;)&amp;gt;}&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;distinct&lt;/FONT&gt; &lt;FONT color="#FF9900"&gt;DestinationCountryName&lt;/FONT&gt;&lt;FONT color="#000000"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#000000"&gt;However, what I am trying to do, is the same thing, but only for jobs where at least one of two fields called &lt;FONT color="#FF9900"&gt;CreditorAccountFF&lt;/FONT&gt; and &lt;FONT color="#FF9900"&gt;DebtorAccountFF&lt;/FONT&gt; is not null. I believe this would be done in set analysis like this:&amp;nbsp;{&amp;lt;&lt;FONT color="#FF9900"&gt;CreditorAccountFF&lt;/FONT&gt; -= {"''"}&amp;gt; + &amp;lt;&lt;FONT color="#FF9900"&gt;DebtorAccountFF&lt;/FONT&gt; -= {"''"}&amp;gt;} - b&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;ut I have just been unable to get it all working in one expression.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Unfortunately I am unable to share any data due to the sensitivity of it, but any suggestions/help would be much appreciated.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508261#M104474</guid>
      <dc:creator>akelleway</dc:creator>
      <dc:date>2025-03-04T17:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using AND &amp; OR conditions in set analysis to get the total count of unique values across two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508281#M104485</link>
      <description>&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count(DISTINCT {&amp;lt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; CreditorAccountFF = {"*"}&amp;gt; + &amp;lt;DebtorAccountFF = {"*"}&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;} OriginCountryName)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;+&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count(DISTINCT {&amp;lt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; CreditorAccountFF = {"*"}&amp;gt; + &amp;lt;DebtorAccountFF = {"*"},&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; DestinationCountryName -= p(OriginCountryName)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;} DestinationCount&lt;SPAN&gt;ryName)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:45:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508281#M104485</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2025-03-04T17:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using AND &amp; OR conditions in set analysis to get the total count of unique values across two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508397#M104514</link>
      <description>&lt;P&gt;Hi Chanty,&lt;/P&gt;
&lt;P&gt;Thanks for your response, however it is not working unfortunately.&lt;/P&gt;
&lt;P&gt;Having counted manually, the first part returns the correct result, as there are 107 Origin Countries and this number is returned if I split the expression in two.&lt;/P&gt;
&lt;P&gt;The second half seems to be where the issue is, as there 39 additional Destination Countries which should be returned here, but the result it is giving is 131. Making a total of 238 rather than the expected 146.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 10:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508397#M104514</guid>
      <dc:creator>akelleway</dc:creator>
      <dc:date>2025-03-05T10:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using AND &amp; OR conditions in set analysis to get the total count of unique values across two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508590#M104544</link>
      <description>&lt;P&gt;NULL means there is NOTHING what has been stored - it couldn't be selected or accessed in any way - at least not directly (indirect ways are complex and have a lot of dependencies and disadvantages).&lt;/P&gt;
&lt;P&gt;If there is NULL directly in the load it could be queried/replaced with approaches like isnull(), len(trim()), coalesce() ... or with NULL variables.&lt;/P&gt;
&lt;P&gt;But it's not within a table else the NULL is the result of an association between tables - missing key-values on any side - it couldn't be grabbed in any way. The resolution here are adjustments to the data-model, for example by checking the missing keys against each other and populating them appropriate.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 12:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AND-amp-OR-conditions-in-set-analysis-to-get-the-total/m-p/2508590#M104544</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-03-06T12:36:30Z</dc:date>
    </item>
  </channel>
</rss>

