<?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 Getting the difference in two dates in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857169#M70747</link>
    <description>&lt;P&gt;I have a table that is set up like this&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Event&lt;/TD&gt;
&lt;TD width="25%"&gt;Planned Date&lt;/TD&gt;
&lt;TD width="25%"&gt;Revised Date&lt;/TD&gt;
&lt;TD width="25%"&gt;Completed Date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Fact Finding&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Customer Contact&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Bill&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I need to calculate the difference between the planned fact finding and the planned billing date.&lt;/P&gt;
&lt;P&gt;Also, the dates can be null as they are being developed.&amp;nbsp; I was thinking it would be something like:&lt;/P&gt;
&lt;P&gt;if the event is = fact finding and planned date isn't null and event = bill and planned date isn't null, calculate, but I don't know how to write that in Qlik.&amp;nbsp; Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 14:16:17 GMT</pubDate>
    <dc:creator>Evan0211</dc:creator>
    <dc:date>2021-11-09T14:16:17Z</dc:date>
    <item>
      <title>Getting the difference in two dates</title>
      <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857169#M70747</link>
      <description>&lt;P&gt;I have a table that is set up like this&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Event&lt;/TD&gt;
&lt;TD width="25%"&gt;Planned Date&lt;/TD&gt;
&lt;TD width="25%"&gt;Revised Date&lt;/TD&gt;
&lt;TD width="25%"&gt;Completed Date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Fact Finding&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Customer Contact&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Bill&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;TD&gt;xxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I need to calculate the difference between the planned fact finding and the planned billing date.&lt;/P&gt;
&lt;P&gt;Also, the dates can be null as they are being developed.&amp;nbsp; I was thinking it would be something like:&lt;/P&gt;
&lt;P&gt;if the event is = fact finding and planned date isn't null and event = bill and planned date isn't null, calculate, but I don't know how to write that in Qlik.&amp;nbsp; Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857169#M70747</guid>
      <dc:creator>Evan0211</dc:creator>
      <dc:date>2021-11-09T14:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the difference in two dates</title>
      <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857181#M70749</link>
      <description>&lt;P&gt;If that's your entire table (that is, there's only ever going to be one line each for each event name), if you want to do this in an expression on the front end,&lt;/P&gt;
&lt;P&gt;Only({&amp;lt; Event = {'Fact Finding'} &amp;gt;} Planned Date) - Only({&amp;lt; Event = {'Bill'} &amp;gt;} Planned Date)&lt;/P&gt;
&lt;P&gt;If either of these null, the result will be null (mathematical actions on null result in null).&lt;/P&gt;
&lt;P&gt;You could also just load the information into a single line scriptside, e.g.&lt;/P&gt;
&lt;P&gt;Load Event, Planned Date, Revised Date, Completed Date&lt;/P&gt;
&lt;P&gt;From Table&lt;/P&gt;
&lt;P&gt;Where Event = 'Fact Finding'&lt;/P&gt;
&lt;P&gt;JOIN&lt;/P&gt;
&lt;P&gt;Load Event, Planned Date as [Bill Planned Date]&lt;/P&gt;
&lt;P&gt;From Table&lt;/P&gt;
&lt;P&gt;Where Event = 'Bill'&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857181#M70749</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-09T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the difference in two dates</title>
      <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857182#M70750</link>
      <description>&lt;P&gt;The calculation shouldn't work if one of the values are null, so you really don't need to add specific scenario for it.&amp;nbsp; Front-end could be something like this.&lt;/P&gt;
&lt;P&gt;only({&amp;lt;Event = {'Fact Finding'}&amp;gt;} [Planned Date]) -&amp;nbsp;only({&amp;lt;Event = {'Bill'}&amp;gt;} [Planned Date])&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857182#M70750</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-11-09T14:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the difference in two dates</title>
      <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857222#M70755</link>
      <description>&lt;P&gt;This my be a stupid question so I am sorry in advance, but will this run in a KPI or would I need to wrap it in a sum?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 15:12:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857222#M70755</guid>
      <dc:creator>Evan0211</dc:creator>
      <dc:date>2021-11-09T15:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the difference in two dates</title>
      <link>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857301#M70761</link>
      <description>&lt;P&gt;Only() is an aggregation function, so assuming there's only one value here, you shouldn't need anything else.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 17:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Getting-the-difference-in-two-dates/m-p/1857301#M70761</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-09T17:33:24Z</dc:date>
    </item>
  </channel>
</rss>

