<?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: AND OR Nested IF statements in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172444#M463585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If( [TSA_ROUTE_DEP_1] &amp;gt;= MakeDate(Year([TSA_ROUTE_DEP_1],Month([TSA_ROUTE_DEP_1]),22)+7/8) and &lt;/P&gt;&lt;P&gt;TSA_ROUTE_DEP_1] &amp;lt;= MakeDate(Year([TSA_ROUTE_DEP_1],Month([TSA_ROUTE_DEP_1]),23)+3/8), 'X')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2016 16:34:39 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-06-22T16:34:39Z</dc:date>
    <item>
      <title>AND OR Nested IF statements</title>
      <link>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172443#M463584</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;i want to create a flag if a date falls into two dates (day or (day +1))&amp;nbsp; AND the hours in the day falls between 21:00 and 09:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because of the date change at midnight i need to ensure that both dates are checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is in order to divine Shift times: dayshift is between 09:00-21:00 (will be the same day) and nightshift will be 21:00-09:00 meaning that the day increases by one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shift will run from 22.06.2016 21:00 to 23.06.2016 09:00.&amp;nbsp; I am currently using these dates in TIMESTAMP format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get an idea of what i want to accomplish please have a look at the code below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Day(Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;[TSA_ROUTE_DEP_1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;,'YYYY/MM/DD hh:mm:ss'))&amp;nbsp;&amp;nbsp;&amp;nbsp; /////this will be in order to get the current date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Day(Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[TSA_ROUTE_DEP_1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,'YYYY/MM/DD hh:mm:ss') + '24:00:00','hh:mm:ss'),'YYYY/MM/DD hh:mm:ss'))&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;&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;&amp;nbsp; //// this will increase the day + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Hour&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;TIMESTAMP&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[TSA_ROUTE_DEP_1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,'hh:mm:ss')) ////////////&amp;nbsp; &amp;gt;=21:00 &amp;lt;=09:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: arial, helvetica, sans-serif;"&gt;In summary, i want to check IF a date is equal to the date selected or the day after and flag all the data within the hours of 21:00 and 09:00.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;For example&amp;nbsp; if Nightshift is selected for the 22nd the following should flag.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;22.04.2016 21:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;23.04.2016 08:50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;22.04.2016 23:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;24.04.2016 10:00&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Hope this helps,Any advice will be appreciated.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Thanks in advance !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 11:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172443#M463584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-22T11:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR Nested IF statements</title>
      <link>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172444#M463585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If( [TSA_ROUTE_DEP_1] &amp;gt;= MakeDate(Year([TSA_ROUTE_DEP_1],Month([TSA_ROUTE_DEP_1]),22)+7/8) and &lt;/P&gt;&lt;P&gt;TSA_ROUTE_DEP_1] &amp;lt;= MakeDate(Year([TSA_ROUTE_DEP_1],Month([TSA_ROUTE_DEP_1]),23)+3/8), 'X')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:34:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172444#M463585</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-06-22T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR Nested IF statements</title>
      <link>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172445#M463586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;DayName( TIMESTAMPFIELD - Maketime(21)) = '22.04.2016' And Hour(&lt;SPAN style="font-size: 13.3333px;"&gt;TIMESTAMPFIELD - Maketime(21) ) &amp;lt;=12, 'X','')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:37:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AND-OR-Nested-IF-statements/m-p/1172445#M463586</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-22T16:37:30Z</dc:date>
    </item>
  </channel>
</rss>

