<?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: Null values in If Statements in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435820#M97005</link>
    <description>&lt;P&gt;If you're doing this into a table, are you sure there are null values? or it can be missing values ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you give more details? Maybe a snapshot of the table?&lt;BR /&gt;&lt;BR /&gt;Until then, take a look at my table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nicolae_Alecu_0-1711700841644.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162929i8260E28B852EC5E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nicolae_Alecu_0-1711700841644.png" alt="Nicolae_Alecu_0-1711700841644.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2024 08:27:38 GMT</pubDate>
    <dc:creator>Nicolae_Alecu</dc:creator>
    <dc:date>2024-03-29T08:27:38Z</dc:date>
    <item>
      <title>Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435704#M96992</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm using the following calculated dimension to compare two columns that contain quite a few nulls.&lt;/P&gt;
&lt;P&gt;=IF(&lt;BR /&gt;IF(ISNULL([t1.col]), 'Val',&amp;nbsp;[t1.col])&lt;BR /&gt;=&lt;BR /&gt;IF(ISNULL([t2.col]), 'Val', [t2.col]), &lt;BR /&gt;0, &lt;BR /&gt;1)&lt;/P&gt;
&lt;P&gt;The columns are basically both the same and as a result, I'm getting a lot of NULL values where both columns contain null values but I want the expression to print 0 if the two values are equal (and I'd consider them to be equal if they are both null).&lt;/P&gt;
&lt;P&gt;I've tried this method, and I've also tried using ALT, as well as LEN(t1.col)&amp;lt;1 but neither of these has corrected the issue.&lt;/P&gt;
&lt;P&gt;I found this article:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/February2024/Subsystems/Hub/Content/Sense_Hub/Scripting/null-value-handling.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/February2024/Subsystems/Hub/Content/Sense_Hub/Scripting/null-value-handling.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;which says that comparing any two null values with any relational operator will result in a null value. But I thought I could circumvent this issue by converting all of my null values into text, however this doesn't seem to work.&lt;/P&gt;
&lt;P&gt;Any help on this would be appreciated, I've tried pulling out each side of the operator in order to confirm that this code:&lt;/P&gt;
&lt;P&gt;IF(ISNULL([t1.col]), 'Val',&amp;nbsp;[t1.col])&lt;/P&gt;
&lt;P&gt;will in fact convert null values into text and it seems to be working just fine but for some reason the if statement still doesn't work.&lt;/P&gt;
&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 15:57:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435704#M96992</guid>
      <dc:creator>lankmachine</dc:creator>
      <dc:date>2024-03-28T15:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435709#M96993</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try coalesce() function .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 16:14:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435709#M96993</guid>
      <dc:creator>Nicolae_Alecu</dc:creator>
      <dc:date>2024-03-28T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435710#M96994</link>
      <description>&lt;P&gt;Thanks for your response!&lt;/P&gt;
&lt;P&gt;Unfortunately, I tried this as well and it doesn't seem to have worked.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 16:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435710#M96994</guid>
      <dc:creator>lankmachine</dc:creator>
      <dc:date>2024-03-28T16:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435820#M97005</link>
      <description>&lt;P&gt;If you're doing this into a table, are you sure there are null values? or it can be missing values ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you give more details? Maybe a snapshot of the table?&lt;BR /&gt;&lt;BR /&gt;Until then, take a look at my table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nicolae_Alecu_0-1711700841644.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162929i8260E28B852EC5E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nicolae_Alecu_0-1711700841644.png" alt="Nicolae_Alecu_0-1711700841644.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 08:27:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435820#M97005</guid>
      <dc:creator>Nicolae_Alecu</dc:creator>
      <dc:date>2024-03-29T08:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435925#M97013</link>
      <description>&lt;P&gt;Mine looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lankmachine_0-1711733009042.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162951i97307E6F6A4D5345/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lankmachine_0-1711733009042.png" alt="lankmachine_0-1711733009042.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I didn't know there was a functional difference between it being null or missing in this case. However, I did run the logic that you ran in your table and it looks something like this so I assume it is null:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lankmachine_1-1711733186320.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162952i3B2B173867B7A5CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lankmachine_1-1711733186320.png" alt="lankmachine_1-1711733186320.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The logic that replaces the null values works fine but for some reason, the if statement still appears as null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 17:32:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2435925#M97013</guid>
      <dc:creator>lankmachine</dc:creator>
      <dc:date>2024-03-29T17:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2436055#M97016</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/293955"&gt;@lankmachine&lt;/a&gt;&amp;nbsp;How did you convert the nulls to values?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 15:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2436055#M97016</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2024-03-30T15:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Null values in If Statements</title>
      <link>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2436056#M97017</link>
      <description>&lt;P&gt;Try this out&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;=IF(&lt;BR /&gt;IsNull([t1.col]) AND IsNull([t2.col]), // If both values are null&lt;BR /&gt;0, // Set result to 0&lt;BR /&gt;If(&lt;BR /&gt;If(IsNull([t1.col]), 'Val', [t1.col]) = If(IsNull([t2.col]), 'Val', [t2.col]), // Compare values after handling nulls&lt;BR /&gt;0, // If values are equal, set result to 0&lt;BR /&gt;1 // If values are not equal, set result to 1&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Also, check out baweja Media.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 16:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Null-values-in-If-Statements/m-p/2436056#M97017</guid>
      <dc:creator>BawejaMedia</dc:creator>
      <dc:date>2024-03-30T16:09:25Z</dc:date>
    </item>
  </channel>
</rss>

