<?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: Filter by 6 week duration, start of the week in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415704#M66478</link>
    <description>&lt;P&gt;Appreciate your help, Txnelson. Thanks a bunch!&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2021 01:06:50 GMT</pubDate>
    <dc:creator>uProf</dc:creator>
    <dc:date>2021-09-06T01:06:50Z</dc:date>
    <item>
      <title>Filter by 6 week duration, start of the week</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415667#M66476</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am interested in filtering data based on time stamp in data between now and 6 weeks, starting from first day of the week (Sunday). This requires additional logic when new year begins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked for date time functions and noticed &lt;EM&gt;date increment&lt;/EM&gt; function that would provide 6 weeks in to the future. How can I get start date that is 6 weeks into the past?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 05 Sep 2021 22:24:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415667#M66476</guid>
      <dc:creator>uProf</dc:creator>
      <dc:date>2021-09-05T22:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter by 6 week duration, start of the week</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415695#M66477</link>
      <description>&lt;P&gt;Here is a little script that should give you a pointer towards solving your 6 week issue.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1630889371195.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35543iF55EA76008D0F254/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1630889371195.png" alt="txnelson_0-1630889371195.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// put in any date using the format of mm/dd/yyyy
inDate = "07/21/2021";
jmpDate = Informat( inDate, "mm/dd/yyyy" );
// Calculate the date 6 weeks before, and adjust to the
// Sunday prior to the absolute 6 week date
sixWeeksBefore = jmpDate - In Weeks( 6 ) - In Days( Day Of Week( jmpDate ) - 1 );
// Calculate the date 6 weeks after, and adjust to the
// Sunday following
sixWeeksAfter = jmpDate + In Weeks( 6 ) + In Days( 8 - Day Of Week( jmpDate ) );

Dialog(
	"Input date is: " || Long Date( jmpDate ),
	"6 weeks before is: " || Long Date( sixWeeksBefore ),
	"6 weeks after is: " || Long Date( sixWeeksAfter )
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look in the Scripting Index for help with the different functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 00:50:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415695#M66477</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-06T00:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter by 6 week duration, start of the week</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415704#M66478</link>
      <description>&lt;P&gt;Appreciate your help, Txnelson. Thanks a bunch!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 01:06:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415704#M66478</guid>
      <dc:creator>uProf</dc:creator>
      <dc:date>2021-09-06T01:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Filter by 6 week duration, start of the week</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415724#M66480</link>
      <description>&lt;P&gt;Date Increment is in my opinion best way to go with this. It might be a bit difficult to understand first but after that it is fairly easy. To go back in time you can use negative increment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// put in any date using the format of mm/dd/yyyy
inDate = "07/21/2021";
jmpDate = Informat(inDate, "Locale Date");
Show(Date Increment(jmpDate, "week", 6, "start"));
Show(Date Increment(jmpDate, "week", -6, "start"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 06:22:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-by-6-week-duration-start-of-the-week/m-p/415724#M66480</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-06T06:22:31Z</dc:date>
    </item>
  </channel>
</rss>

