<?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: If(Missing = Missing, 1, 2) always yields Null in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659392#M538715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(IsNull(%UserID) Or IsNull(SpecialUser.SpecialValue) Or Len(Trim(User.UserValue)) = 0, 'Normal User' ,If(User.UserValue = SpecialUser.SpecialValue,'Special User'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 10:40:01 GMT</pubDate>
    <dc:creator>anbu1984</dc:creator>
    <dc:date>2014-09-22T10:40:01Z</dc:date>
    <item>
      <title>If(Missing = Missing, 1, 2) always yields Null</title>
      <link>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659391#M538714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed a difference in how different versions of Qlikview manage one specific case with calculated dimensions.&lt;/P&gt;&lt;P&gt;And QV 11.0 does it better than 11.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 tables: Fact, User, SpecialUserMark. My chart counts unique identifiers in Fact. But the dimension is based on Users.&lt;/P&gt;&lt;P&gt;In particular, I want to count how many records in Fact belong to Normal and Special users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the calculated dimension is the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;User.UserValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SpecialUser.SpecialValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'Special User', 'Normal User') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression is the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FactTable.DistinctID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that some Fact table rows don't have the corresponding user. So, the dimension formula translates more or less in IF(Missing = Missing, 'something', 'something else').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is how QV 11.0 (11.00.11282.0 SR1 64-bit Edition) displays the table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV_11.0.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/67314_QV_11.0.png" style="width: 620px; height: 260px;" /&gt;&lt;/P&gt;&lt;P&gt;Naturally, the missing users (UserId = k) are treated as "something else" =&amp;gt; "Normal User".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is how QV 11.2 (11.20.11922.0 SR2 64-bit Edition) displays the same table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV_11.2.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/67315_QV_11.2.png" style="width: 620px; height: 265px;" /&gt;&lt;/P&gt;&lt;P&gt;The missing users are treated as NULL (I tried changing the NULL symbol representation). The whole formula gets invalidated. So, wrapping it inside IF(ISNULL(IF(missing=missing,...,...)),...,...) does not work as it keeps always yielding NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find attached the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only solution I came up with is to create "fake" records in the User table, which makes it enough for the formula to get evaluated correctly.&lt;/P&gt;&lt;P&gt;But I have too many similar problems in the same dashboard and these "fake" records eventually affect calculations in other charts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 10:06:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659391#M538714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-22T10:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: If(Missing = Missing, 1, 2) always yields Null</title>
      <link>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659392#M538715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(IsNull(%UserID) Or IsNull(SpecialUser.SpecialValue) Or Len(Trim(User.UserValue)) = 0, 'Normal User' ,If(User.UserValue = SpecialUser.SpecialValue,'Special User'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 10:40:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659392#M538715</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-09-22T10:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re: If(Missing = Missing, 1, 2) always yields Null</title>
      <link>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659393#M538716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to me that this expression is enough:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14113870161633849" jivemacro_uid="_14113870161633849"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IsNull&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;User.UserValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IsNull&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%UserID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;User.UserValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SpecialUser.SpecialValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;BR /&gt; 'Special User',&lt;BR /&gt;&lt;BR /&gt; 'Normal User'&lt;BR /&gt;&lt;BR /&gt;) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 11:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Missing-Missing-1-2-always-yields-Null/m-p/659393#M538716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-22T11:48:52Z</dc:date>
    </item>
  </channel>
</rss>

