<?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 do I write this IF Statement for Days Late? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762765#M271212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(len(trim(field)) &amp;gt; 0, ..., ....)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to check if field is null, empty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date1 - date2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to calc the difference between date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(date1 &amp;gt; date2, ..., ....)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to compare dates&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 Jan 2015 21:52:51 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-01-25T21:52:51Z</dc:date>
    <item>
      <title>How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762762#M271209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write an IF statement for number of days a Job is late.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my sample data below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/76206_Capture.JPG" style="height: 236px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the rule I am trying to write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Days Late should be calculated in numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Resolved_Date is greater than Requested_Date calculate the difference.&lt;/P&gt;&lt;P&gt;If Requested Date is blank, calculate Days_Late using Date Due&lt;/P&gt;&lt;P&gt;If both are blank insert 'Unresolved'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone share an example of this? Sorry I am new to writing if statement with dates &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 21:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762762#M271209</guid>
      <dc:creator />
      <dc:date>2015-01-25T21:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762763#M271210</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(Requested_Date)=0,Resolved_Date-Requested_Date,If(isnull(Due_Date)=0,Resolved_Date-Due_Date,'UnResolved'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&amp;nbsp; expression will provide a negative number if the Resolved date is before the requested date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 21:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762763#M271210</guid>
      <dc:creator />
      <dc:date>2015-01-25T21:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762764#M271211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aushik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the =0 mean when it finds a null it place a 0 on true for null?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 21:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762764#M271211</guid>
      <dc:creator />
      <dc:date>2015-01-25T21:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762765#M271212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(len(trim(field)) &amp;gt; 0, ..., ....)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to check if field is null, empty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date1 - date2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to calc the difference between date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(date1 &amp;gt; date2, ..., ....)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to compare dates&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 21:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762765#M271212</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-01-25T21:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762766#M271213</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;No, here isnull(dimension) returns true&amp;nbsp; or false. So if the column is null it returns -1 and if value is not null it returns 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may also use simply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnull(field), dim1, dim2)...this will be the reverse of checking 'isnull(field)=0'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 21:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762766#M271213</guid>
      <dc:creator />
      <dc:date>2015-01-25T21:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762767#M271214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Aushik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to add one more criteria, if both Date_Requested and Due_Date are blank then it should calculate the difference between Resolve_Date and Created_Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how I can add this in? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 22:16:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762767#M271214</guid>
      <dc:creator />
      <dc:date>2015-01-25T22:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762768#M271215</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;You may do that by including another if condition nested inside the above example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the most optimal way would be to define a new field in the reload script as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(isnull(Requested_Date),If(isnull(Due_Date),Created_Date,Due_Date),Requested_Date) as Target_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the UI you can simply use Resolved_Date-Target_Date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 22:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762768#M271215</guid>
      <dc:creator />
      <dc:date>2015-01-25T22:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762769#M271216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aushik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the Target Date search for values in the sequential order you have in the If Statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2015 23:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762769#M271216</guid>
      <dc:creator />
      <dc:date>2015-01-25T23:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write this IF Statement for Days Late?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762770#M271217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes...first it checks the Requested_Date. If Requested_Date is null it checks the 'Due_Date' If both of these dates are null, it uses&amp;nbsp; the created date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 19:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-write-this-IF-Statement-for-Days-Late/m-p/762770#M271217</guid>
      <dc:creator />
      <dc:date>2015-01-26T19:28:12Z</dc:date>
    </item>
  </channel>
</rss>

