<?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 Various IF conditions within a Count Distinct in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697804#M451035</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have this expression to start with: It gives a percentage value of the serial numbers that have a Reason issue divided by all serial numbers.&lt;/P&gt;&lt;P&gt;1 - (Count (distinct(if(isnull(Reason)=0,Upper([Serial number])))) / Count(distinct(Upper([Serial number]))))&lt;/P&gt;&lt;P&gt;I need to add to this expression several conditions:&lt;/P&gt;&lt;P&gt;For the serial numbers that have a Reason issue, I need to count only the ones with specific conditions:&lt;/P&gt;&lt;P&gt;- If&amp;nbsp; [Job Number] starts with WR, then count only the ones that are NPI =-{"=isnull(NPI)"}&lt;/P&gt;&lt;P&gt;- But we also need to count [Job Number] that starts with WB and WP but that are NOT NPI...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it's clear enough &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Any possible help? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 15:09:20 GMT</pubDate>
    <dc:creator>Mauqlikhelp</dc:creator>
    <dc:date>2020-04-29T15:09:20Z</dc:date>
    <item>
      <title>Various IF conditions within a Count Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697804#M451035</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have this expression to start with: It gives a percentage value of the serial numbers that have a Reason issue divided by all serial numbers.&lt;/P&gt;&lt;P&gt;1 - (Count (distinct(if(isnull(Reason)=0,Upper([Serial number])))) / Count(distinct(Upper([Serial number]))))&lt;/P&gt;&lt;P&gt;I need to add to this expression several conditions:&lt;/P&gt;&lt;P&gt;For the serial numbers that have a Reason issue, I need to count only the ones with specific conditions:&lt;/P&gt;&lt;P&gt;- If&amp;nbsp; [Job Number] starts with WR, then count only the ones that are NPI =-{"=isnull(NPI)"}&lt;/P&gt;&lt;P&gt;- But we also need to count [Job Number] that starts with WB and WP but that are NOT NPI...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it's clear enough &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Any possible help? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697804#M451035</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-04-29T15:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Various IF conditions within a Count Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697808#M451036</link>
      <description>&lt;P&gt;Perhaps this?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Match([Job Number],'WR*'), 1 - (Count ({&amp;lt;NPI ={"=isnull(NPI)"}&amp;gt;} distinct(if(isnull(Reason)=0,Upper([Serial number])))) / Count({&amp;lt;NPI ={"=isnull(NPI)"}&amp;gt;} distinct(Upper([Serial number])))), &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If(Match([Job Number],'WR*', 'WP*'), 1 - (Count (distinct(if(isnull(Reason)=0,Upper([Serial number])))) / Count(distinct(Upper([Serial number]))))))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:13:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697808#M451036</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2020-04-29T15:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Various IF conditions within a Count Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697816#M451037</link>
      <description>&lt;P&gt;But is it possible to have my conditions inside a single Count?&lt;/P&gt;&lt;P&gt;The WR (with NPI) AND WB/WP (without NPI) needs to be calculated inside the same count.&lt;/P&gt;&lt;P&gt;The conditions of the serial number also needs to be applied to the number I divide by:&lt;/P&gt;&lt;P&gt;1 - count distinct (if job=WR and is NPI) AND (job=WB,WP and is NOT npi) AND isnull(reason)=0 then we divide by count (if job=WR and is NPI) or (job=WB,WP and is NOT NPI)&lt;/P&gt;&lt;P&gt;So when I divide, I just remove the isnull(reason) condition&lt;/P&gt;&lt;P&gt;Thanks for your time!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:25:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1697816#M451037</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-04-29T15:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Various IF conditions within a Count Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1698862#M451096</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I tried to make it more simple:&lt;/P&gt;&lt;P&gt;NPI field: This field marks the part numbers that have a released date.&lt;/P&gt;&lt;P&gt;What makes it difficult here is that it's possible that a WB or WP work order does not have a released date yet, but some does. That's why I want to calculate the NPI products for all work orders W*, and then I need to add the WB and WP work orders that are not NPI. But this below is not working... Any ideas what I am doing wrong?&lt;/P&gt;&lt;P&gt;if(isnull(NPI)=0,(Count (Distinct{&amp;lt;[Job number] = {'W*'}&amp;gt;} [Job number])),'')&lt;BR /&gt;+&lt;BR /&gt;if(isnull(NPI)&amp;lt;&amp;gt;0,(Count (Distinct{&amp;lt;[Job number] = {'WB*', 'WP*'}&amp;gt;} [Job number])),'')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 17:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-IF-conditions-within-a-Count-Distinct/m-p/1698862#M451096</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-05-04T17:02:36Z</dc:date>
    </item>
  </channel>
</rss>

