<?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 statements with Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378210#M1170159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only issue I'm having is that &lt;/P&gt;&lt;P&gt;Planned date is pulling from TORDFD.txt, while Actual Date is pulling form TORDOP.txt..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've tried putting the statement in the 2nd load statement of the Actual Date, &lt;/P&gt;&lt;P&gt;But when I tried running it, it had an error saying that it couldn't recognize the Planned Date..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on where I should load the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2012 17:28:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-15T17:28:58Z</dc:date>
    <item>
      <title>If statements with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378208#M1170157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to create an expression. &lt;/P&gt;&lt;P&gt;(not sure whether to place in the Script or in a Chart)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have 2 fields Titled&lt;/P&gt;&lt;P&gt;[Planned Date]-- list of dates&lt;/P&gt;&lt;P&gt;[Actual Date]-- list of dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I created a reference field:&lt;/P&gt;&lt;P&gt;STATUS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DAYS_STATUS&lt;/P&gt;&lt;P&gt;Early&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; +1&lt;/P&gt;&lt;P&gt;Late&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; -1&lt;/P&gt;&lt;P&gt;On Time&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; 0&lt;/P&gt;&lt;P&gt;Scheduled&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; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the Planned Date is before the Actual Date, The Status should be 'On Time' with a DAYS_STATUS of 0. &lt;/P&gt;&lt;P&gt;If the Actual Date is before the Planned Date, The Status is Early with DAYS_STATUS of 1.&lt;/P&gt;&lt;P&gt;If the Planned Date is before&amp;nbsp; Today and the Actual Date is blank/ null, the Stutus should be 'Late' with a DAYS_STATUS of -1&lt;/P&gt;&lt;P&gt;If The Planned Date is later than Today's date, the Status should be Scheduled with a DAYS_STATUS of 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far.. I've come up with this type of script.. but it's not working and I'm not sure what to do..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If [date([Planned Date]) &amp;lt; date([Actual Date]), then&amp;nbsp; STATUS= 'On Time' and DAYS_STATUS = 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, What I'd like to create is a table which shows the Order Number, the STATUS to see which parts are on time, early, late &amp;amp; still scheduled &lt;/P&gt;&lt;P&gt;and to make a count of the DAYS_STATUS to see how behind production is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestions would be very appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Please Write the Script in the Comment instead of attaching files&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 16:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378208#M1170157</guid>
      <dc:creator />
      <dc:date>2012-08-15T16:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statements with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378209#M1170158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Please add these two statements to your Load script to generate the table fields STATUS and DAYS_STATUS. I hope it meets your requirements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;lt; [Actual Date], 'On Time',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;gt; [Actual Date], 'Early',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;lt; today() AND isnull([Actual Date]) = -1, 'Late',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;gt; today(), 'Scheduled')))) AS STATUS,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;lt; [Actual Date], 0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;gt; [Actual Date], 1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;lt; today() AND isnull([Actual Date]) = -1, -1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;IF ([Planned Date] &amp;gt; today(), 0)))) AS DAYS_STATUS,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 17:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378209#M1170158</guid>
      <dc:creator>manojkvrajan</dc:creator>
      <dc:date>2012-08-15T17:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: If statements with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378210#M1170159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only issue I'm having is that &lt;/P&gt;&lt;P&gt;Planned date is pulling from TORDFD.txt, while Actual Date is pulling form TORDOP.txt..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've tried putting the statement in the 2nd load statement of the Actual Date, &lt;/P&gt;&lt;P&gt;But when I tried running it, it had an error saying that it couldn't recognize the Planned Date..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on where I should load the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 17:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378210#M1170159</guid>
      <dc:creator />
      <dc:date>2012-08-15T17:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: If statements with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378211#M1170160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;There are lot of work arounds to it. However, I would begin with the following logic. Please let me know if it helps or upload a sample datasource file and let me look at it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Create a table named &lt;STRONG&gt;Table_Temp&lt;/STRONG&gt; that would join TORDFD.txt and TORDOP.txt data with the common field (as Key).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Create a &lt;STRONG&gt;Table_Actual &lt;/STRONG&gt;using the &lt;STRONG&gt;RESIDENT LOAD &lt;/STRONG&gt;incorporating the IF logic&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Drop the Table_Temp&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Sample script:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Table_Temp:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load &lt;STRONG&gt;Key,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM TORDFD.txt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JOIN &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load &lt;STRONG&gt;Key,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM TORDOP.txt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table_Actual:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD *,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;lt; [Actual Date], 'On Time',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;gt; [Actual Date], 'Early',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;lt; today() AND isnull([Actual Date]) = -1, 'Late',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;gt; today(), 'Scheduled')))) AS STATUS, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;lt; [Actual Date], 0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;gt; [Actual Date], 1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;lt; today() AND isnull([Actual Date]) = -1, -1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;IF ([Planned Date] &amp;gt; today(), 0)))) AS DAYS_STATUS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT &lt;STRONG&gt;Table_Temp&lt;/STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;DROP TABLE &lt;STRONG&gt;Table_Temp&lt;/STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 17:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378211#M1170160</guid>
      <dc:creator>manojkvrajan</dc:creator>
      <dc:date>2012-08-15T17:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: If statements with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378212#M1170161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IT WORKED!!!!!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was just one error that said:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 88px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="88"&gt;Unknown statement&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;Table_Temp:&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, the data uploaded!&lt;/P&gt;&lt;P&gt; &amp;amp; Everything else seems to be functioning just fine &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, Manoj!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 18:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statements-with-Dates/m-p/378212#M1170161</guid>
      <dc:creator />
      <dc:date>2012-08-15T18:38:06Z</dc:date>
    </item>
  </channel>
</rss>

