<?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 Date subtracting in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362746#M134845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to script the difference between Days between a order and a return;&lt;/P&gt;&lt;P&gt;I have the folowing line of script;&lt;/P&gt;&lt;P&gt;interval(RETURN_DATE-ORDER_DATE, 'DD, hh:mm:ss')&amp;nbsp;&amp;nbsp;&amp;nbsp; as RETURN_period&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it gives this error: Undefined function 'interval' in expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the qlikview file, the problem is at line 87,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the help in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2012 14:16:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-21T14:16:58Z</dc:date>
    <item>
      <title>Date subtracting in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362746#M134845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to script the difference between Days between a order and a return;&lt;/P&gt;&lt;P&gt;I have the folowing line of script;&lt;/P&gt;&lt;P&gt;interval(RETURN_DATE-ORDER_DATE, 'DD, hh:mm:ss')&amp;nbsp;&amp;nbsp;&amp;nbsp; as RETURN_period&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it gives this error: Undefined function 'interval' in expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the qlikview file, the problem is at line 87,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the help in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 14:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362746#M134845</guid>
      <dc:creator />
      <dc:date>2012-03-21T14:16:58Z</dc:date>
    </item>
    <item>
      <title>Date subtracting in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362747#M134846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is not in the interval-function but in that you are trying to use in in the SQL-statement. The interval-function is a QlikView function which can be used in a LOAD section. To solve your problem, first get data into QlikView by SQL, then use the interval when transforming the data in a LOAD. In you example SQL both values, use a LOAD above like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RETURN: //FEIT&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;interval(RETURN_DATE-ORDER_DATE, 'DD, hh:mm:ss')&amp;nbsp;&amp;nbsp;&amp;nbsp; as RETURN_period;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt; RI.RETURN_CODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN_code, //PK&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;OH.SALES_STAFF_CODE&amp;amp;'|'&amp;amp; DATEPART('YYYY', RETURN_DATE&amp;nbsp; )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LINK_key,&lt;/P&gt;&lt;P&gt;RETURN_DATE,&lt;/P&gt;&lt;P&gt;ORDER_DATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; FROM (RETURNED_ITEM RI&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olof Laurin, Senior Consultant at Tacticus AB, &lt;A href="http://www.tacticus.se"&gt;http://www.tacticus.se&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 14:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362747#M134846</guid>
      <dc:creator />
      <dc:date>2012-03-21T14:38:21Z</dc:date>
    </item>
    <item>
      <title>Date subtracting in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362748#M134847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for the reply, the error is gone, but now I only get - as value in the RETURN_period.. I hoped I would get just number of days.. Any idea what's wrong now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 14:59:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-subtracting-in-script/m-p/362748#M134847</guid>
      <dc:creator />
      <dc:date>2012-03-21T14:59:25Z</dc:date>
    </item>
  </channel>
</rss>

