<?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: Using if condition in an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637255#M476388</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= count(distinct if(new_currentaum&amp;gt;=0, [Organisation Name]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2014 10:46:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-03T10:46:49Z</dc:date>
    <item>
      <title>Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637253#M476386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am new to Qlikview and when I try to use the if statement, it keeps bringing the value zero. Can anyone help with the below please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the expression to count Organisation names (ignoring duplicates) where the AUM is greater than zero. This is what I wrote in the expression -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if(new_currentaum&amp;gt;=0, count(distinct [Organisation Name]), 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jalps&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637253#M476386</guid>
      <dc:creator />
      <dc:date>2014-06-03T10:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637254#M476387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;count({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;new_currentaum&lt;/SPAN&gt; =&amp;nbsp; {"&amp;gt;=0"}&amp;gt;}distinct [Organisation Name])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:46:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637254#M476387</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-06-03T10:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637255#M476388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= count(distinct if(new_currentaum&amp;gt;=0, [Organisation Name]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:46:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637255#M476388</guid>
      <dc:creator />
      <dc:date>2014-06-03T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637256#M476389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works! So I dont need to use if statement in Qlikview it seems. Thanks very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637256#M476389</guid>
      <dc:creator />
      <dc:date>2014-06-03T10:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637257#M476390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use if statement, but set analysis produces the result faster&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637257#M476390</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-06-03T10:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637258#M476391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jalpa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your case set analysis proposed by &lt;A href="https://community.qlik.com/qlik-users/88778"&gt;Mayil Vahanan Ramasamy&lt;/A&gt; is better &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Of course there are also cases, where if is useful ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 10:54:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637258#M476391</guid>
      <dc:creator />
      <dc:date>2014-06-03T10:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637259#M476392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again. Is it also possible to use set analysis or if statement on another expression rather than a dimension? For example, in the above condition I was trying to put the condition that if AUM is greater than zero then count Organisation Name. However, I now have an expression which subtotals the AUM. Can I use that expression in the if statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 11:07:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637259#M476392</guid>
      <dc:creator />
      <dc:date>2014-06-03T11:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637260#M476393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression cannot be evaluated properly. The reason is that you have a field reference that isn't aggregated.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = if(&lt;STRONG style="color: #ff0000;"&gt;new_currentaum&lt;/STRONG&gt;&amp;gt;=0, count(distinct [Organisation Name]), 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;QlikView evaluates this expression once for every dimensional value, so if there are several new_currentaum possible, this field reference will return NULL (It is evaluated as Only(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;new_currentaum&lt;/SPAN&gt;)). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;If you want it to be evaluated once per dimensional value, you should use an aggregation function, e.g. Max():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =if(Max(new_currentaum)&amp;gt;=0, count(distinct [Organisation Name]), 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;But if you want it to be evaluated once per record of raw data, you should put the If() inside the aggregation function, just as &lt;A href="https://community.qlik.com/qlik-users/122330"&gt;Dariusz Mielczarek&lt;/A&gt; suggests:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =count(distinct if(new_currentaum&amp;gt;=0, [Organisation Name]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Set analysis is a third way to do it. It is like making a selection - but just for this expression. Then you should do what &lt;A href="https://community.qlik.com/qlik-users/88778"&gt;Mayil Vahanan Ramasamy&lt;/A&gt; suggests:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =count({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;new_currentaum&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; =&amp;nbsp; {"&amp;gt;=0"}&amp;gt;}distinct [Organisation Name])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;But Set Analysis is not like a condition: So you cannot toggle between different expressions.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;HIC&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 11:18:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637260#M476393</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-06-03T11:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637261#M476394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Hic. I see your point and used the max function but I still get the same issue - it counts the organisation where currentaum = 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 13:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637261#M476394</guid>
      <dc:creator />
      <dc:date>2014-06-03T13:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637262#M476395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;count({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;new_currentaum&lt;/SPAN&gt; =&amp;nbsp; {"&amp;gt;0"}&amp;gt;}distinct [Organisation Name])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 13:29:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637262#M476395</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-06-03T13:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using if condition in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637263#M476396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone for your help. Using just greater than zero works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jalps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 14:33:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-if-condition-in-an-expression/m-p/637263#M476396</guid>
      <dc:creator />
      <dc:date>2014-06-03T14:33:03Z</dc:date>
    </item>
  </channel>
</rss>

