<?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 Use previous date when comparing shift data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278521#M499926</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 am trying to look at the activity of employees who work shifts which span across midnight each day. so if they work up to 4 am that is classed as the previous day. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;Time &lt;/P&gt;&lt;P&gt;In the script I want to add a new field Activity date.&lt;/P&gt;&lt;P&gt; I have tried &lt;/P&gt;&lt;P&gt;IF('00:00:00' &amp;lt; Time &amp;gt; '03:59:00', (date-1), date) as " Activity Date", &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this doesn't work, am sure it's a simple syntax thing?&lt;/P&gt;&lt;P&gt;Many thanks &lt;/P&gt;&lt;P&gt;Matt &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2011 08:47:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-10T08:47:30Z</dc:date>
    <item>
      <title>Use previous date when comparing shift data</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278521#M499926</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 am trying to look at the activity of employees who work shifts which span across midnight each day. so if they work up to 4 am that is classed as the previous day. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;Time &lt;/P&gt;&lt;P&gt;In the script I want to add a new field Activity date.&lt;/P&gt;&lt;P&gt; I have tried &lt;/P&gt;&lt;P&gt;IF('00:00:00' &amp;lt; Time &amp;gt; '03:59:00', (date-1), date) as " Activity Date", &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this doesn't work, am sure it's a simple syntax thing?&lt;/P&gt;&lt;P&gt;Many thanks &lt;/P&gt;&lt;P&gt;Matt &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 08:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278521#M499926</guid>
      <dc:creator />
      <dc:date>2011-06-10T08:47:30Z</dc:date>
    </item>
    <item>
      <title>Use previous date when comparing shift data</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278522#M499927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Date is a timestamp then this would do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(hour(Date)&amp;lt;4,date-1,date) as ActivityDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Time a character string like this '00:00:00' ? then try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(subfield(Time,1)&amp;lt;4,date-1,date) as ActivityDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope thsi helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 09:00:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278522#M499927</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-10T09:00:29Z</dc:date>
    </item>
    <item>
      <title>Use previous date when comparing shift data</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278523#M499928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Many thansk Pat that seams to do the trick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 09:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278523#M499928</guid>
      <dc:creator />
      <dc:date>2011-06-10T09:40:52Z</dc:date>
    </item>
    <item>
      <title>Use previous date when comparing shift data</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278524#M499929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;and you thought you wre the one with syntax probelms &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 09:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-date-when-comparing-shift-data/m-p/278524#M499929</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-10T09:45:13Z</dc:date>
    </item>
  </channel>
</rss>

