<?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: Help with script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396135#M147734</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any more help with this anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2012 07:30:48 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2012-09-12T07:30:48Z</dc:date>
    <item>
      <title>Help with script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396131#M147730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to work out how long a call is open for. The working day is between 9 -5 Mon-Fri. If a call is opened on a saturday then qlikview should report it as being opened on the Monday. and if the call is closed on the weekend then qlikview should report it as being closed on friday end of day. If any calls are open and closed on weekday then qlikview should report the actual day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i have used for my start/end times..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13473808527725490" jivemacro_uid="_13473808527725490"&gt;&lt;P&gt; timestamp(LastWorkDate([Create DateTime],1,$(vBankHols))+$(vWeekDayStartTime)) as [Create WorkingDateTime],&amp;nbsp; // roll forward to Monday SoD (*1)&lt;/P&gt;&lt;P&gt; timestamp(FirstWorkDate([Closed DateTime],1,$(vBankHols))+$(vWeekDayEndTime)) as [Closed WorkingDateTime],&amp;nbsp; // roll backward to Friday EoD (*1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;The problem i am getting is that my new field [Create WorkingDateTime] displays ALL original call open times as 9am. I only want it to be 9am (The following Monday) if opened on a weekend. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 16:24:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396131#M147730</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-09-11T16:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396132#M147731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all, anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 19:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396132#M147731</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-09-11T19:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396133#M147732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hopkins,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the LastWorkDate(Date, 1) returns in case of Workdays the Day itself, otherwise the next Workday. In &lt;EM&gt;both &lt;/EM&gt;cases your are adding the timeoffset&amp;nbsp; "&lt;CODE class="jive-code jive-sql"&gt;$(vWeekDayStartTime)&lt;/CODE&gt;".&lt;/P&gt;&lt;P&gt;So try this modification of your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Timestamp(LastWorkDate(&lt;CODE class="jive-code jive-sql"&gt;[&lt;SPAN class="jive-sql-keyword"&gt;Create&lt;/SPAN&gt; DateTime]&lt;/CODE&gt;,1) + if(weekDay(&lt;CODE class="jive-code jive-sql"&gt;[&lt;SPAN class="jive-sql-keyword"&gt;Create&lt;/SPAN&gt; DateTime]&lt;/CODE&gt;)&amp;gt;4, &lt;CODE class="jive-code jive-sql"&gt;$(vWeekDayStartTime)&lt;/CODE&gt;,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 21:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396133#M147732</guid>
      <dc:creator />
      <dc:date>2012-09-11T21:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396134#M147733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for that, it seems to work if you select a weekend but if you select a week day or no day at all (So all days are selected) it returns 00:00:00 as the time.. &lt;/P&gt;&lt;P&gt;The time needs ti stay as the original time logged if logged on Mon-Fri 9-5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 21:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396134#M147733</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-09-11T21:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396135#M147734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any more help with this anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 07:30:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script/m-p/396135#M147734</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-09-12T07:30:48Z</dc:date>
    </item>
  </channel>
</rss>

