<?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: Need to compare two dates columns in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383172#M31561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for instant reply ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing this as an expression as I am creating dimension or so called column to represent these date differences . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now if i write this as an expression to create a dimension&amp;nbsp; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I wrote IF condition&amp;nbsp; but how to write then condition&amp;nbsp; :-&lt;/P&gt;&lt;P&gt;For instance I write below code in the expression :-&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(len([Actual date])&amp;gt;0,[Actual date],date(Today(),'MM/DD/YYYY'))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------- upto here I am fine as I am checking IF condition&amp;nbsp; but after this Again I want to Subtract&amp;nbsp;&amp;nbsp;&amp;nbsp; Today's date with Forecast dates&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;so how should i write here in the expression .How do I connect IF condition and below mentioned code &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Ex:- Interval [&lt;STRONG&gt;Today date&lt;/STRONG&gt; - [Forecast date ]] ,'d')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Oct 2017 16:40:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-17T16:40:56Z</dc:date>
    <item>
      <title>Need to compare two dates columns</title>
      <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383168#M31557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys , I have two columns of Actual Date and Forecast dates . I need to compare these two columns and need to find the difference between these two dates . Could you please help me how to do this . How do I show difference ?&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;Actual date&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Forecast Dates&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;12/12/2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/09/2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need one more column to show that whats the difference by how many (days, months , years)&amp;nbsp; between actual and forecast&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In Advance,&lt;/P&gt;&lt;P&gt;ravi &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 13:06:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383168#M31557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-17T13:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two dates columns</title>
      <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383169#M31558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;During the load script, use the Interval function.&lt;/P&gt;&lt;P&gt;As an example, I did something like the bellow script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x:&lt;/P&gt;&lt;P&gt;load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Actual date, Forecast Dates&lt;/P&gt;&lt;P&gt;12/12/2016, 01/09/2015&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Interval([Actual date]-[Forecast Dates],'d') as [Difference Days],&lt;/P&gt;&lt;P&gt;floor(Interval([Actual date]-[Forecast Dates],'d')/30) as [Difference Months],&lt;/P&gt;&lt;P&gt;floor(Interval([Actual date]-[Forecast Dates],'d')/30/12) as [Difference Years]&lt;/P&gt;&lt;P&gt;Resident x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;drop table x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your data, it would give the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/179953_sample.png" style="height: 349px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 13:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383169#M31558</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-17T13:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two dates columns</title>
      <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383170#M31559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the detailed expression ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Another question is as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Date column and I want to check if there are any null values in the Date column . And if there are null values in the date column then I want to put today's date and subtract it with forecast dates . &lt;/P&gt;&lt;P&gt;How should this be done .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;ravi shinge &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:15:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383170#M31559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-17T16:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two dates columns</title>
      <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383171#M31560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x:&lt;/P&gt;&lt;P&gt;load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Actual date, Forecast Dates&lt;/P&gt;&lt;P&gt;12/12/2016, 01/09/2015&lt;/P&gt;&lt;P&gt;,01/05/2014&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Interval([Actual date]-[Forecast Dates],'d') as [Difference Days],&lt;/P&gt;&lt;P&gt;floor(Interval([Actual date]-[Forecast Dates],'d')/30) as [Difference Months],&lt;/P&gt;&lt;P&gt;floor(Interval([Actual date]-[Forecast Dates],'d')/30/12) as [Difference Years];&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// Gets the nulls with today date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if(len([Actual date])&amp;gt;0,[Actual date],date(Today(),'MM/DD/YYYY')) as [Actual date],&lt;/P&gt;&lt;P&gt;[Forecast Dates]&lt;/P&gt;&lt;P&gt;Resident x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table x;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:23:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383171#M31560</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-17T16:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two dates columns</title>
      <link>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383172#M31561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for instant reply ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing this as an expression as I am creating dimension or so called column to represent these date differences . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now if i write this as an expression to create a dimension&amp;nbsp; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I wrote IF condition&amp;nbsp; but how to write then condition&amp;nbsp; :-&lt;/P&gt;&lt;P&gt;For instance I write below code in the expression :-&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(len([Actual date])&amp;gt;0,[Actual date],date(Today(),'MM/DD/YYYY'))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------- upto here I am fine as I am checking IF condition&amp;nbsp; but after this Again I want to Subtract&amp;nbsp;&amp;nbsp;&amp;nbsp; Today's date with Forecast dates&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;so how should i write here in the expression .How do I connect IF condition and below mentioned code &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Ex:- Interval [&lt;STRONG&gt;Today date&lt;/STRONG&gt; - [Forecast date ]] ,'d')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:40:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-to-compare-two-dates-columns/m-p/1383172#M31561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-17T16:40:56Z</dc:date>
    </item>
  </channel>
</rss>

