<?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: blank field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435135#M34470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If these three lines are all in the load script, then the updated value of [DS_Need_Date] and [DS_Forecast_Date] are not available when line 3 is executed, so the condition always evaluates to false. If either field is null, empty, or non-numeric, this expression will return null and will never return zero. A simpler way would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Alt([DS Need Date]-[DS Forecast Date], 0) as [Need-For&lt;STRONG&gt;e&lt;/STRONG&gt;cast]&amp;nbsp; // note field name spelling&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This assumes that the two date fields are numeric data values and not strings.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2017 08:36:22 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2017-11-08T08:36:22Z</dc:date>
    <item>
      <title>blank field</title>
      <link>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435134#M34469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my app, I have 2 columns with two type of date [DS_Forecast_Date] and [DS_Need_Date]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to create a third column which makes the difference between these two dates but if one of this two columns is 'empty' then put zero, so I wrote in the script :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(len(trim([DS Forecast Date]))=0,'empty',date([DS Forecast Date])) as [DS_Forecast_Date] ,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(len(trim([DS Need Date]))=0,'empty',date([DS Need Date])) as [DS_Need_Date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if([DS Need Date]='empty' or [DS Forecast Date]='empty','0',[DS Need Date]-[DS Forecast Date]) as [Need-Forcast]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But&amp;nbsp; returned column [Need-Forecast] has blank instead of zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it's clear...&lt;/P&gt;&lt;P&gt;Do you have and idea ?&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 08:27:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435134#M34469</guid>
      <dc:creator>victor_greffet</dc:creator>
      <dc:date>2017-11-08T08:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: blank field</title>
      <link>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435135#M34470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If these three lines are all in the load script, then the updated value of [DS_Need_Date] and [DS_Forecast_Date] are not available when line 3 is executed, so the condition always evaluates to false. If either field is null, empty, or non-numeric, this expression will return null and will never return zero. A simpler way would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Alt([DS Need Date]-[DS Forecast Date], 0) as [Need-For&lt;STRONG&gt;e&lt;/STRONG&gt;cast]&amp;nbsp; // note field name spelling&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This assumes that the two date fields are numeric data values and not strings.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 08:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435135#M34470</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-11-08T08:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: blank field</title>
      <link>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435136#M34471</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 would try turning them to numbers and check for a result.&lt;/P&gt;&lt;P&gt;So change the end to NUM(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[DS Need Date])-NUM([DS Forecast Date])) as [Need-Forcast]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If that works, then wrap that back into a date() funtion.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 08:36:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/blank-field/m-p/1435136#M34471</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2017-11-08T08:36:31Z</dc:date>
    </item>
  </channel>
</rss>

