<?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: Two if's condition and a count in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694952#M450881</link>
    <description>&lt;P&gt;Perhaps this?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;Reason={"=Len(Reason)=0"}, [Job number]={'WB*'}&amp;gt;} [Serial number])/&lt;BR /&gt;Count(DISTINCT {&amp;lt;[Job number]={'WB*'}&amp;gt;} [Serial number])&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 15:26:37 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2020-04-20T15:26:37Z</dc:date>
    <item>
      <title>Two if's condition and a count</title>
      <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694948#M450880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to count a yield percentage but only under a certain condition.&lt;/P&gt;&lt;P&gt;Right now, without the added condition, I am using this formula to calculate the yield percentage, which works good:&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 now need to calculate a new yield, but only for Jobnumber that starts with WB.&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;1-(if([Job number] like 'WB*',Count(distinct(if(isnull(Reason)=0,Upper([Serial number])))))&lt;BR /&gt;/ if([Job number] like 'WB*',Count(distinct(Upper([Serial number])))))&lt;/P&gt;&lt;P&gt;But it's not working.&lt;/P&gt;&lt;P&gt;Any ideas? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 15:21:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694948#M450880</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-04-20T15:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Two if's condition and a count</title>
      <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694952#M450881</link>
      <description>&lt;P&gt;Perhaps this?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;Reason={"=Len(Reason)=0"}, [Job number]={'WB*'}&amp;gt;} [Serial number])/&lt;BR /&gt;Count(DISTINCT {&amp;lt;[Job number]={'WB*'}&amp;gt;} [Serial number])&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 15:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694952#M450881</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2020-04-20T15:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Two if's condition and a count</title>
      <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694978#M450883</link>
      <description>&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;It is not quite working though, I am getting 100%, 100%, 100%, when I should be getting 93.1%, 95.5%, 100%.&lt;/P&gt;&lt;P&gt;Maybe it has something to do with the Len(Reason)?&lt;/P&gt;&lt;P&gt;The "Reason" condition was there so that, if a serial number has a Reason entered (a defect), then it counts it, and divides it by the total number of serial numbers.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 16:07:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694978#M450883</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-04-20T16:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Two if's condition and a count</title>
      <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694995#M450885</link>
      <description>&lt;P&gt;Found it!&lt;/P&gt;&lt;P&gt;Only changed a bit your formula:&lt;/P&gt;&lt;P&gt;1-(&lt;BR /&gt;Count(DISTINCT {&amp;lt;Reason={"=Len(Reason)&amp;lt;&amp;gt;0"}, [Job number]={'WB*'}&amp;gt;} [Serial number])/&lt;BR /&gt;Count(DISTINCT {&amp;lt;[Job number]={'WB*'}&amp;gt;} [Serial number])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Solved, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 16:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1694995#M450885</guid>
      <dc:creator>Mauqlikhelp</dc:creator>
      <dc:date>2020-04-20T16:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Two if's condition and a count</title>
      <link>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1695072#M450891</link>
      <description>&lt;P&gt;Glad you found the solution. Please mark correct answer to close this thread&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 00:42:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-if-s-condition-and-a-count/m-p/1695072#M450891</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2020-04-21T00:42:29Z</dc:date>
    </item>
  </channel>
</rss>

