<?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: If statement in Interval count in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042989#M350890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please provide me a sample data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Apr 2016 10:22:55 GMT</pubDate>
    <dc:creator>HirisH_V7</dc:creator>
    <dc:date>2016-04-03T10:22:55Z</dc:date>
    <item>
      <title>If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042985#M350886</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;How can I add if statement when calculating interval between two dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate number of day from OrderDate to DeliveryDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following simple expression as both fields are timestamps.&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14596663940001927" jivemacro_uid="_14596663940001927"&gt;
&lt;P&gt;= Date(DeliveryDate) - Date(OrderDate)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if Order was placed after 12PM then I want to - 1 from the Total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 06:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042985#M350886</guid>
      <dc:creator />
      <dc:date>2016-04-03T06:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042986#M350887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;may be this will be helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/65106"&gt;Working hours only&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 07:50:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042986#M350887</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-04-03T07:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042987#M350888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From a sample data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14596743802842525" jivemacro_uid="_14596743802842525"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;Interval([Delivery Date]-[Order Date],'DD') as Days,&lt;/P&gt;
&lt;P&gt;Interval(IF(TimeStamp#(TimeStamp([Order Date],'h:mm:ss[.fff] TT'),'h:mm:ss[.fff] TT')&amp;gt;='12:00:00 PM',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (Interval([Delivery Date]-[Order Date],'DD'))-1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Interval([Delivery Date]-[Order Date],'DD')) ,'DD')as DaysWithCondition&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;Delivery Date,Order Date&lt;/P&gt;
&lt;P&gt;02/04/2015 11:23:07 AM,30/03/2015 11:23:09 AM&lt;/P&gt;
&lt;P&gt;02/04/2015 11:23:07 AM,30/03/2015 12:00:00 PM&lt;/P&gt;
&lt;P&gt;02/04/2015 11:23:07 AM,30/03/2015 01:00:00 PM&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using the if Condition For time &lt;STRONG&gt;&amp;gt;='12:00:00 PM'&amp;nbsp; &lt;/STRONG&gt;and Interval Function calculating the number of days Difference,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the Difference at output,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF we use timestamp means we can get the accurate time lapse between two dates, For now its only Days Difference,&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="120328" alt="Date(DeliveryDate) - Date(OrderDate).PNG" class="jive-image image-1" src="/legacyfs/online/120328_Date(DeliveryDate) - Date(OrderDate).PNG" style="height: 192px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;PFA,&lt;/P&gt;&lt;P&gt;Hirish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 09:09:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042987#M350888</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2016-04-03T09:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042988#M350889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Harish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to exclude weekend and public holidays?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a separate table listing all the public holiday dates. would that help ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 09:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042988#M350889</guid>
      <dc:creator />
      <dc:date>2016-04-03T09:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042989#M350890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please provide me a sample data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 10:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042989#M350890</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2016-04-03T10:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042990#M350891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to exclude weekends and public holidays from the difference of order date and delivery date, you can use NetWorkDays() function.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-5314"&gt;Find Net Working Days&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 10:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042990#M350891</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-03T10:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Interval count</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042991#M350892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Sunny.. I did post a similar post couple of days ago but no one replied. Do you think the link you suggested will help me solve the question I posted here.. &lt;A href="https://community.qlik.com/thread/211872"&gt;how to calculate days between two timestamps&lt;/A&gt; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 10:46:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-Interval-count/m-p/1042991#M350892</guid>
      <dc:creator />
      <dc:date>2016-04-03T10:46:47Z</dc:date>
    </item>
  </channel>
</rss>

