<?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 Creating a script function that also returns NULL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-script-function-that-also-returns-NULL/m-p/882159#M655222</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;&lt;/P&gt;&lt;P&gt;In my model I try to create a variable that contains a formula that returns the content from a table given a current selection, but i also want it to return the NULL (blank) value when the cell is blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, my script looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vVariable = 'sum({$&amp;lt;KV_Start_Date = {"&amp;lt; =' &amp;amp; ' $ ' &amp;amp; ' (=min(Date))"}&amp;gt;} KV_Actual_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In practice, the data table containing KV_Value_Actual only have one cell for each selection. Thus, I'm actually only trying to get the content of the cell in the table returned by the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that the "sum" function returns blank cells as 0, not Null().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is an example of the content I want the formula to return:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Selection&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KV_Value_Actual&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;What I want the formula to return&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate all help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 13:14:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-06-12T13:14:00Z</dc:date>
    <item>
      <title>Creating a script function that also returns NULL</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-script-function-that-also-returns-NULL/m-p/882159#M655222</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;&lt;/P&gt;&lt;P&gt;In my model I try to create a variable that contains a formula that returns the content from a table given a current selection, but i also want it to return the NULL (blank) value when the cell is blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, my script looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vVariable = 'sum({$&amp;lt;KV_Start_Date = {"&amp;lt; =' &amp;amp; ' $ ' &amp;amp; ' (=min(Date))"}&amp;gt;} KV_Actual_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In practice, the data table containing KV_Value_Actual only have one cell for each selection. Thus, I'm actually only trying to get the content of the cell in the table returned by the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that the "sum" function returns blank cells as 0, not Null().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is an example of the content I want the formula to return:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Selection&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KV_Value_Actual&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;What I want the formula to return&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate all help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 13:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-script-function-that-also-returns-NULL/m-p/882159#M655222</guid>
      <dc:creator />
      <dc:date>2015-06-12T13:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a script function that also returns NULL</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-script-function-that-also-returns-NULL/m-p/882160#M655223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the only() function instead of sum()&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; font-size: 13px;"&gt;let vVariable = 'only({$&amp;lt;KV_Start_Date = {"&amp;lt; =' &amp;amp; ' $ ' &amp;amp; ' (=min(Date))"}&amp;gt;} KV_Actual_Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 13:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-script-function-that-also-returns-NULL/m-p/882160#M655223</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-12T13:17:29Z</dc:date>
    </item>
  </channel>
</rss>

