<?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: How to handle the null values in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431431#M1166092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Also, to check if the value is null you should use isnull(Discount1) function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Sep 2012 16:12:31 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2012-09-22T16:12:31Z</dc:date>
    <item>
      <title>How to handle the null values in the script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431429#M1166090</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;I am loading the data via OLE DB from MS Access Views. the Views containd basic components of net sales calculation like price, discounts, volume.. the Net sales calculation for each row is done in the script by preceading Load statement, so the synthax of my script is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Net_Price,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Volume,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Discount1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Discount2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Product,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/other descriptive dimensons/,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Net_Price * Volume * (1-Discount1) *(1-Discount2) as &lt;STRONG&gt;Net_Sales&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SQL Select *&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;From MyAccessView&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is that Discounts take sometimes null values and for such records, Net_Sales is as well null what is wrong, as this null should have been treated in the formula as zero... I handled this in discount definition as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Discount1='',0,Discount1) as Discount__1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem is that I can not use Discount__1 name when defining Net_Sales, I can incorporate if... formulas in the Net_Sales definition, but having around 10 kinds of discpounts, it is going to be a looooong formula. Can I handle this differently?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I was trying to handle this in Acces Views by usnig NZ(Discount1,0) formula, but then QV does not see the Views any more which as I got to know is because it does not recognise NZ() function :-((&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2012 10:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431429#M1166090</guid>
      <dc:creator />
      <dc:date>2012-09-22T10:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the null values in the script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431430#M1166091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;Net_Price * Volume * (1-RangeSum(Discount1)) *(1-RangeSum(Discount2)) as Net_Sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See more on &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" href="http://community.qlik.com/docs/DOC-3155"&gt;http://community.qlik.com/docs/DOC-3155&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2012 13:18:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431430#M1166091</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-09-22T13:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the null values in the script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431431#M1166092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Also, to check if the value is null you should use isnull(Discount1) function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2012 16:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431431#M1166092</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-22T16:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the null values in the script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431432#M1166093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot... this was working of course, but anyway I must have resigned from my beginning approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I simply connected my query to QV, I was getting script load errors with really no reasone. After some tests I concluded it must have something to do with many formulas being in the query, because when I connected the table containing the same data as in my big Access Query (so simply I changed the type of my query from "select" to "Table create"), then all the data were loaded within a second. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, As I load the data anyway from Query to Table before refreshing QV, I used NZ() formulas in Query to assure no Null values...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answering Whiteline - when I used the formula you suggest, then I was still getting empty values, so probably the values were not null as per its QV definition &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2012 20:01:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-handle-the-null-values-in-the-script/m-p/431432#M1166093</guid>
      <dc:creator />
      <dc:date>2012-09-22T20:01:15Z</dc:date>
    </item>
  </channel>
</rss>

