<?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 Problem when using if statement and count in same expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354701#M131644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use if statement and count in same expression.&amp;nbsp; When using the following expression i'm getting no data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(Identity = 'A', count(distinct{&amp;lt;Identity = {'A'}&amp;gt;}[ID]), If (Identity = 'B',count(distinct{&amp;lt;Identity = {'B'}&amp;gt;}[ID])))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2012 15:36:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-15T15:36:06Z</dc:date>
    <item>
      <title>Problem when using if statement and count in same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354701#M131644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use if statement and count in same expression.&amp;nbsp; When using the following expression i'm getting no data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(Identity = 'A', count(distinct{&amp;lt;Identity = {'A'}&amp;gt;}[ID]), If (Identity = 'B',count(distinct{&amp;lt;Identity = {'B'}&amp;gt;}[ID])))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 15:36:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354701#M131644</guid>
      <dc:creator />
      <dc:date>2012-03-15T15:36:06Z</dc:date>
    </item>
    <item>
      <title>Problem when using if statement and count in same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354702#M131645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the syntax is := count (if(condition,value))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 15:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354702#M131645</guid>
      <dc:creator />
      <dc:date>2012-03-15T15:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using if statement and count in same expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354703#M131646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting the distinct after the set expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: arial,helvetica,sans-serif;"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;If(Identity = 'A' , count({&amp;lt;Identity = {'A'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;[ID]), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;If (Identity = 'B' , count({&amp;lt;Identity = {'B'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;[ID])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Or you can create 2 expressions &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;A:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;count({&amp;lt;Identity = {'A'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;[ID])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;B:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;count({&amp;lt;Identity = {'B'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;[ID])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 15:42:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-when-using-if-statement-and-count-in-same-expression/m-p/354703#M131646</guid>
      <dc:creator />
      <dc:date>2012-03-15T15:42:56Z</dc:date>
    </item>
  </channel>
</rss>

