<?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 Weekstart not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506459#M189336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone out there can help me solve what I expect is a simple problem that I can't figure out myself.&amp;nbsp; I need to:&lt;/P&gt;&lt;P&gt;1. Take a time value (e.g. 2013-09-05T13:30:44Z) and turn it into a date format.&lt;/P&gt;&lt;P&gt;2. Save the date in a new field.&lt;/P&gt;&lt;P&gt;3. Take that date and find the Thursday of the previous week.&lt;/P&gt;&lt;P&gt;4. Save the previous Thursday as a new field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4 is where my code below is not working.&amp;nbsp; I get blank "Created_On_Week" values.&amp;nbsp;&amp;nbsp; Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_one:&lt;/P&gt;&lt;P&gt;LOAD created_date_time,&lt;/P&gt;&lt;P&gt;MakeDate(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Left(created_date_time, 4),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mid(created_date_time,6,2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mid(created_date_time,9,2)) as [created_on_date],&lt;/P&gt;&lt;P&gt;WeekStart(created_on_date, 0, -4) as [Created_on_Week]&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;--- This doesn't work&lt;/P&gt;&lt;P&gt;FROM [&amp;lt;URL removed for posting&amp;gt;] (XmlSimple, Table is [DATA/data]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Oct 2013 14:31:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-22T14:31:16Z</dc:date>
    <item>
      <title>Weekstart not working</title>
      <link>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506459#M189336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone out there can help me solve what I expect is a simple problem that I can't figure out myself.&amp;nbsp; I need to:&lt;/P&gt;&lt;P&gt;1. Take a time value (e.g. 2013-09-05T13:30:44Z) and turn it into a date format.&lt;/P&gt;&lt;P&gt;2. Save the date in a new field.&lt;/P&gt;&lt;P&gt;3. Take that date and find the Thursday of the previous week.&lt;/P&gt;&lt;P&gt;4. Save the previous Thursday as a new field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4 is where my code below is not working.&amp;nbsp; I get blank "Created_On_Week" values.&amp;nbsp;&amp;nbsp; Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_one:&lt;/P&gt;&lt;P&gt;LOAD created_date_time,&lt;/P&gt;&lt;P&gt;MakeDate(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Left(created_date_time, 4),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mid(created_date_time,6,2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mid(created_date_time,9,2)) as [created_on_date],&lt;/P&gt;&lt;P&gt;WeekStart(created_on_date, 0, -4) as [Created_on_Week]&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;--- This doesn't work&lt;/P&gt;&lt;P&gt;FROM [&amp;lt;URL removed for posting&amp;gt;] (XmlSimple, Table is [DATA/data]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 14:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506459#M189336</guid>
      <dc:creator />
      <dc:date>2013-10-22T14:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Weekstart not working</title>
      <link>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506460#M189337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1382453306322237" jivemacro_uid="_1382453306322237"&gt;&lt;/PRE&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13824533063086595" jivemacro_uid="_13824533063086595" modifiedtitle="true"&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Table_one:&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *,&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WeekStart(created_on_date, 0, -4) as [Created_on_Week] ;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD created_date_time,&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MakeDate(&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Left(created_date_time, 4),&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Mid(created_date_time,6,2),&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Mid(created_date_time,9,2)) as [created_on_date];&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &amp;lt;--- This doesn't work&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM [&amp;lt;URL removed for posting&amp;gt;] (XmlSimple, Table is [DATA/data]);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You´re tryning to use a function that expects a date and passing a string as parameter.&lt;/P&gt;&lt;P&gt;Using a pre-Load we can use the value of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;created_on_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 14:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506460#M189337</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2013-10-22T14:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Weekstart not working</title>
      <link>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506461#M189338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Newbie mistake!&amp;nbsp; Many thanks...I knew it would be a quick fix. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 14:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506461#M189338</guid>
      <dc:creator />
      <dc:date>2013-10-22T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Weekstart not working</title>
      <link>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506462#M189339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would also work in a single load then such strings could be directly converted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_one:&lt;/P&gt;&lt;P&gt;LOAD date(date#(keepchar('2013-09-05T13:30:44Z', '0123456789-:'), 'YYYY-MM-DDhh:mm:ss'), 'MM/DD/YYY hh:mm:ss') as created_date_time&lt;/P&gt;&lt;P&gt;date(date#(keepchar('2013-09-05T13:30:44Z', '0123456789-:'), 'YYYY-MM-DDhh:mm:ss'), 'MM/DD/YYY') as created_on_date,&lt;/P&gt;&lt;P&gt;weekstart(date(date#(keepchar('2013-09-05T13:30:44Z', '0123456789-:'), 'YYYY-MM-DDhh:mm:ss'), 'MM/DD/YYY'), 0, -4) as Created_on_Week&lt;/P&gt;&lt;P&gt;FROM [&amp;lt;URL removed for posting&amp;gt;] (XmlSimple, Table is [DATA/data]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 15:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekstart-not-working/m-p/506462#M189339</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-10-22T15:03:56Z</dc:date>
    </item>
  </channel>
</rss>

