<?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: get rows two weeks before today's date in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295774#M55725</link>
    <description>&lt;P&gt;You need to make the selection in the data table before performing the Subset....see below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; select where( :A &amp;gt; 20 &amp;amp; :A &amp;lt; 40 &amp;amp; :Date &amp;gt;= (Today() - In Weeks( 2 )) );

dtSub = dt &amp;lt;&amp;lt; subset(
	selected rows( 1 ),
	columns( :Year, :B, :Month, :Week, :Date, :Product, :A ),
	output table( "abc" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did not fully test the code, but it should be very close.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2020 15:16:55 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-08-31T15:16:55Z</dc:date>
    <item>
      <title>get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295633#M55709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a script, I would like to be able to select rows that are two weeks before today's date.&lt;/P&gt;&lt;P&gt;I would like to run the script and depending on what day it is, that JMP displays the last two weeks only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that I used in my script the function "subset" and the function :&lt;/P&gt;&lt;P&gt;"get rows where" (: A&amp;gt; 40 &amp;amp;: A &amp;lt;59.5), and I would like to add something else to select the rows corresponding to two weeks before today's date (the date when I will run the script)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;Have a good day&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:36:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295633#M55709</guid>
      <dc:creator>Emma1</dc:creator>
      <dc:date>2023-06-09T23:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295674#M55713</link>
      <description>&lt;P&gt;In the Scripting Guide, under "Date Time" there is a list of all of the Date Time functions that are available.&amp;nbsp; I assume you want to do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theRows = dt &amp;lt;&amp;lt; get rows where( :Date &amp;gt;= Today() - InWeeks(2));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or to adjust back to the beginning of the current date (i.e. Midnight)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theRows = dt &amp;lt;&amp;lt; get rows where( :Date &amp;gt;= Today() - Time Of Day( Today() ) - InWeeks(2));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 10:53:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295674#M55713</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-31T10:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295773#M55724</link>
      <description>&lt;P&gt;Thanks, I tested this but it still doesn't work&lt;BR /&gt;What I'm looking to do is create a new base of my main database with a few columns I'm interested in and specifying that I only want column A with values between 20 and 40 and two weeks before today.&lt;BR /&gt;I have this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table ();
dtSub = dt &amp;lt;&amp;lt; subset (
Output Table ("abc"),
rows (dt &amp;lt;&amp;lt; get rows where (: A&amp;gt; 20 &amp;amp;: A &amp;lt;40 &amp;amp;: Date&amp;gt; = Today () - InWeeks (2)));
columns (: Year,: B,: Month,: Week,: Date,: Product,: A)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 18:53:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295773#M55724</guid>
      <dc:creator>Emma1</dc:creator>
      <dc:date>2020-08-31T18:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295774#M55725</link>
      <description>&lt;P&gt;You need to make the selection in the data table before performing the Subset....see below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; select where( :A &amp;gt; 20 &amp;amp; :A &amp;lt; 40 &amp;amp; :Date &amp;gt;= (Today() - In Weeks( 2 )) );

dtSub = dt &amp;lt;&amp;lt; subset(
	selected rows( 1 ),
	columns( :Year, :B, :Month, :Week, :Date, :Product, :A ),
	output table( "abc" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did not fully test the code, but it should be very close.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 15:16:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/295774#M55725</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-31T15:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298006#M55842</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Sorry but I tried your code but still can't do it ..&lt;BR /&gt;I'm new to script programming, so I don't have the reflexes that others can have in this kind of little script&lt;/P&gt;&lt;P&gt;Can I still ask you for help?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 20:37:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298006#M55842</guid>
      <dc:creator>Emma1</dc:creator>
      <dc:date>2020-09-02T20:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298007#M55843</link>
      <description>&lt;P&gt;Please attach a sample data table, and I will see where the issue is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, why are you trying to do this by writing a script?&amp;nbsp; This can all be done interactively.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 20:45:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298007#M55843</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-02T20:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298026#M55844</link>
      <description>&lt;P&gt;I would like the script to first allow to generate another database to extract only what interests me, then to send the report by email to then close the new database without saving it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 21:02:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298026#M55844</guid>
      <dc:creator>Emma1</dc:creator>
      <dc:date>2020-09-02T21:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298120#M55848</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please attach a sample data table.&amp;nbsp; I am assuming the issue is in the data.&amp;nbsp; If it is not working, and there are no messages in the log, then we need to look at what is happening with the data.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 21:46:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298120#M55848</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-02T21:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298411#M55860</link>
      <description>&lt;P&gt;Here is an example of my database&lt;/P&gt;&lt;P&gt;Have a good day&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 13:13:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298411#M55860</guid>
      <dc:creator>Emma1</dc:creator>
      <dc:date>2020-09-03T13:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: get rows two weeks before today's date</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298433#M55862</link>
      <description>&lt;P&gt;The issue is that the columns specified in the Subset phrase were not the names of the columns in the data table.&amp;nbsp; Your names are in French, so all that has to be done, is to change the names of the columns in the script to match the names in the data table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; select where( :A &amp;gt; 20 &amp;amp; :A &amp;lt; 40 &amp;amp; :Date &amp;gt;= (Today() - In Weeks( 2 )) );

dtSub = dt &amp;lt;&amp;lt; subset(
	selected rows( 1 ),
	columns( :Année, :B, :Quantième, :Mois, :Date, :Produit, :A ),
	output table( "abc" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Sep 2020 13:21:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-two-weeks-before-today-s-date/m-p/298433#M55862</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-03T13:21:50Z</dc:date>
    </item>
  </channel>
</rss>

