<?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: Dates are driving me mad!! please help in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-are-driving-me-mad-please-help/m-p/2525047#M15061</link>
    <description>&lt;P&gt;as I didn't reply I am leaving this here for anyone in the same boat.&lt;BR /&gt;I couldn't fix it in the sql so I fixed it in the autocalendar load&lt;/P&gt;
&lt;P&gt;this is the line that you need&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Dual(&lt;BR /&gt;'W' &amp;amp; Num(Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28, '00'),&lt;BR /&gt;Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28&lt;BR /&gt;) AS [Week]&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this rightly or wrongly locks the week number to the 5/7/25 that is week 28 and so the rest of the weeks fall into line. I have some more testing to do and then I will use this to filter etc on&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Dual(&lt;BR /&gt;Num(Year($1) - 2000, '00') &amp;amp; '-' &amp;amp; Num(Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28, '00'),&lt;BR /&gt;Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28&lt;BR /&gt;) AS [Year-Week],&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Wed, 23 Jul 2025 08:18:34 GMT</pubDate>
    <dc:creator>Jacktheripperz</dc:creator>
    <dc:date>2025-07-23T08:18:34Z</dc:date>
    <item>
      <title>Dates are driving me mad!! please help</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-are-driving-me-mad-please-help/m-p/2524929#M15059</link>
      <description>&lt;P&gt;Hi I have a simple data load using sql&lt;BR /&gt;&lt;BR /&gt;if i run in sql developer.&lt;/P&gt;
&lt;TABLE width="665px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="665px"&gt;Select&lt;BR /&gt;trunc(DATECOLUMN1),&lt;BR /&gt;to_char(DATECOLUMN1 + 4, 'YY') || '-' ||to_char(to_date(A.DATECOLUMN1, 'DD-MM-YYYY HH24:MI:SS') +4, 'IW') &lt;BR /&gt;FROM TESTING A&lt;BR /&gt;where to_char(to_date(A.DATECOLUMN1, 'DD-MM-YYYY HH24:MI:SS') +4, 'IW')&amp;nbsp; = '28'&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;I get dates 05-JUL-25 to 11-JUL-25 for week 28 this is exactly what I want the week to start on a saturday and to end on a fridy (custom week)&lt;BR /&gt;&lt;BR /&gt;if I do a Qlik load&lt;/P&gt;
&lt;TABLE width="666"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="666"&gt;LIB CONNECT TO 'TESTINGDATA';&lt;BR /&gt;QUALIFY *;&lt;BR /&gt;// Ensure ISO week logic&lt;BR /&gt;SET FirstWeekDay=0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Monday&lt;BR /&gt;SET BrokenWeeks=0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Only full weeks&lt;BR /&gt;SET ReferenceDay=4;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Thursday-based week start (ISO)&lt;BR /&gt;SET DateFormat='DD-MMM-YY';&lt;BR /&gt;&lt;BR /&gt;[test]:&lt;BR /&gt;SELECT &lt;BR /&gt;&amp;nbsp; TRUNC(A.DATECOLUMN1) AS TRUNC_DATE,&lt;BR /&gt;&amp;nbsp; TO_CHAR(A.DATECOLUMN1 + 4, 'YY') || '-' || TO_CHAR(A.DATECOLUMN1 + 4, 'IW') AS WEEK_LABEL&lt;BR /&gt;FROM TESTING A&lt;BR /&gt;WHERE TO_CHAR(A.DATECOLUMN1 + 4, 'IW') = '28';&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I get dates 07-JUL-25 to 13-JUL-25 for week 28 this isnt 1 day out it is 2 days off. I just cant seem to get the sql to behave?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 12:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-are-driving-me-mad-please-help/m-p/2524929#M15059</guid>
      <dc:creator>Jacktheripperz</dc:creator>
      <dc:date>2025-07-22T12:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dates are driving me mad!! please help</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-are-driving-me-mad-please-help/m-p/2525047#M15061</link>
      <description>&lt;P&gt;as I didn't reply I am leaving this here for anyone in the same boat.&lt;BR /&gt;I couldn't fix it in the sql so I fixed it in the autocalendar load&lt;/P&gt;
&lt;P&gt;this is the line that you need&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Dual(&lt;BR /&gt;'W' &amp;amp; Num(Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28, '00'),&lt;BR /&gt;Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28&lt;BR /&gt;) AS [Week]&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this rightly or wrongly locks the week number to the 5/7/25 that is week 28 and so the rest of the weeks fall into line. I have some more testing to do and then I will use this to filter etc on&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Dual(&lt;BR /&gt;Num(Year($1) - 2000, '00') &amp;amp; '-' &amp;amp; Num(Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28, '00'),&lt;BR /&gt;Floor((Floor($1) - Floor(MakeDate(2025, 7, 5))) / 7) + 28&lt;BR /&gt;) AS [Year-Week],&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 23 Jul 2025 08:18:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-are-driving-me-mad-please-help/m-p/2525047#M15061</guid>
      <dc:creator>Jacktheripperz</dc:creator>
      <dc:date>2025-07-23T08:18:34Z</dc:date>
    </item>
  </channel>
</rss>

