<?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 Deriving field from two other fields in script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Deriving-field-from-two-other-fields-in-script/m-p/1984617#M81249</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;I have two fields, "Event Documented Date" (for example, 20/10/2015) and "Event Booking Date" (30/03/2015). I've created a straight table and added a calculated dimension which subtracts the latter from the former, giving the correct answer of 204 days.&lt;/P&gt;
&lt;P&gt;I'd like to create a field in my script called "Event Documented Interval" which simply subtracts the event booking date from the event documented date. Right now it looks like this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;[Event Documented Date]-[Event Booking Date] as [Event Documented Interval],&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;But when I add the dimension "Event Documented Interval" to the straight table, it gives the value as -1108032. The value should never be negative, as "Event Documented Date" is never earlier than "Event Booking Date".&lt;/P&gt;
&lt;P&gt;Any ideas what I'm doing wrong?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 09:47:17 GMT</pubDate>
    <dc:creator>FionnM</dc:creator>
    <dc:date>2022-09-23T09:47:17Z</dc:date>
    <item>
      <title>Deriving field from two other fields in script</title>
      <link>https://community.qlik.com/t5/App-Development/Deriving-field-from-two-other-fields-in-script/m-p/1984617#M81249</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;I have two fields, "Event Documented Date" (for example, 20/10/2015) and "Event Booking Date" (30/03/2015). I've created a straight table and added a calculated dimension which subtracts the latter from the former, giving the correct answer of 204 days.&lt;/P&gt;
&lt;P&gt;I'd like to create a field in my script called "Event Documented Interval" which simply subtracts the event booking date from the event documented date. Right now it looks like this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;[Event Documented Date]-[Event Booking Date] as [Event Documented Interval],&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;But when I add the dimension "Event Documented Interval" to the straight table, it gives the value as -1108032. The value should never be negative, as "Event Documented Date" is never earlier than "Event Booking Date".&lt;/P&gt;
&lt;P&gt;Any ideas what I'm doing wrong?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 09:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Deriving-field-from-two-other-fields-in-script/m-p/1984617#M81249</guid>
      <dc:creator>FionnM</dc:creator>
      <dc:date>2022-09-23T09:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Deriving field from two other fields in script</title>
      <link>https://community.qlik.com/t5/App-Development/Deriving-field-from-two-other-fields-in-script/m-p/1984666#M81253</link>
      <description>&lt;P&gt;I figured it out. "Event Booking Date" was being loaded as a text string rather than as a numerical field. Loading it as a numerical field cleared the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 11:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Deriving-field-from-two-other-fields-in-script/m-p/1984666#M81253</guid>
      <dc:creator>FionnM</dc:creator>
      <dc:date>2022-09-23T11:04:48Z</dc:date>
    </item>
  </channel>
</rss>

