<?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 Using a date and time range to determine a weekend in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294545#M705951</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;Thank you for quick reply, but in my example I want Friday Evening to be classed as the weekend. The example above would only tell me if it was a Saturday or Sunday, correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to put this in script for loading. I have come up with a solution but its a very long if statement. If someone can come up with an easier way, I would be very grateful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF((WeekDay(DTATime)='Fri') AND If((Time(Frac(DTATime))&amp;gt;=Time('20:00:00') AND Time(Frac(DTATime))&amp;lt;=Time('23:59:59')), 'Night', 'Day')='Night','Weekend', IF((WeekDay(DTATime)='Sat') OR (WeekDay(DTATime)='Sun'),'Weekend', IF((WeekDay(DTATime)='Mon') AND If((Time(Frac(DTATime))&amp;gt;=Time('00:00:00') AND Time(Frac(DTATime))&amp;lt;=Time('08:00:00')), 'Night', 'Day')='Night','Weekend','Weekday'))) as DTADayType&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2012 14:16:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-17T14:16:02Z</dc:date>
    <item>
      <title>Using a date and time range to determine a weekend</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294543#M705949</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;When loading the script I would like to to determine if a date and time field is a weekend or not i.e After Friday 20:00 and before Monday 8:00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date and time format that comes in from the database is: dd/mm/yyyy hh:mm:ss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 11:32:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294543#M705949</guid>
      <dc:creator />
      <dc:date>2012-02-17T11:32:56Z</dc:date>
    </item>
    <item>
      <title>Using a date and time range to determine a weekend</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294544#M705950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From QlikView help:&lt;/P&gt;&lt;H4 style="background-color: #c0c0c0;"&gt;weekday&lt;A name="kanchor472"&gt;&lt;/A&gt;&lt;A name="weekday"&gt;&lt;/A&gt;( &lt;SPAN style="font-style: italic;"&gt;date&lt;/SPAN&gt; )&lt;/H4&gt;&lt;P&gt;Week day. Returns an integer between 0-6.&lt;/P&gt;&lt;H2&gt;Example:&lt;/H2&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;weekday(&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-weight: bold;"&gt; '1971-10-30' )&lt;/SPAN&gt;returns &lt;SPAN style="font-style: italic;"&gt;5&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 11:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294544#M705950</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2012-02-17T11:46:13Z</dc:date>
    </item>
    <item>
      <title>Using a date and time range to determine a weekend</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294545#M705951</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;Thank you for quick reply, but in my example I want Friday Evening to be classed as the weekend. The example above would only tell me if it was a Saturday or Sunday, correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to put this in script for loading. I have come up with a solution but its a very long if statement. If someone can come up with an easier way, I would be very grateful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF((WeekDay(DTATime)='Fri') AND If((Time(Frac(DTATime))&amp;gt;=Time('20:00:00') AND Time(Frac(DTATime))&amp;lt;=Time('23:59:59')), 'Night', 'Day')='Night','Weekend', IF((WeekDay(DTATime)='Sat') OR (WeekDay(DTATime)='Sun'),'Weekend', IF((WeekDay(DTATime)='Mon') AND If((Time(Frac(DTATime))&amp;gt;=Time('00:00:00') AND Time(Frac(DTATime))&amp;lt;=Time('08:00:00')), 'Night', 'Day')='Night','Weekend','Weekday'))) as DTADayType&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 14:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-date-and-time-range-to-determine-a-weekend/m-p/294545#M705951</guid>
      <dc:creator />
      <dc:date>2012-02-17T14:16:02Z</dc:date>
    </item>
  </channel>
</rss>

