<?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: Selecting data for past X number of days in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/246230#M48371</link>
    <description>&lt;P&gt;Thanks for the catch&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2020 13:54:47 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-02-06T13:54:47Z</dc:date>
    <item>
      <title>Selecting data for past X number of days</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/245926#M48325</link>
      <description>&lt;P&gt;I have a data set that contains past 60 days of data and I want just past 7 days of data. Data column name "OUT_DATE" in the format of&amp;nbsp;&amp;nbsp; MM/DD/YYY HH:MM:SS AM/PM. Date is not sorted and in random order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the following discussion answered by super user "txnelson" (&lt;A href="https://community.jmp.com/t5/Discussions/Date-function-in-jsl/td-p/57122" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Date-function-in-jsl/td-p/57122&lt;/A&gt;) and did my script as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=Open("Report.csv");// Opening the main datafile
P7D = dt &amp;lt;&amp;lt; select where( today() - In Days( 7 ) &amp;lt; :OUT_DATE );// Selecting past 7 days data and assigning it to P7D
P7D &amp;lt;&amp;lt; Save("P7D.csv");//&amp;nbsp;Save&amp;nbsp;P7D&amp;nbsp;as&amp;nbsp;csv&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But my output file "P7D.csv" has an exact copy of the "Report.csv".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I store only past 7 days of data in P7D?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 00:36:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/245926#M48325</guid>
      <dc:creator>djmomo</dc:creator>
      <dc:date>2020-02-05T00:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data for past X number of days</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/245974#M48329</link>
      <description>&lt;P&gt;Selection of given rows does not affect the saving.&amp;nbsp; The easiest way to do that, is to create a subset of the data, based upon the selection, and then save that subset. (The below is corrected code: see&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt; )&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=Open("Report.csv");// Opening the main datafile
dt &amp;lt;&amp;lt; select where( today() - In Days( 7 ) &amp;lt; :OUT_DATE );// Selecting past 7 days data and assigning it to P7D
P7D = dt &amp;lt;&amp;lt; subset(invisible, selected columns(0), selected rows(1));
P7D &amp;lt;&amp;lt; Save("P7D.csv");// Save P7D as csv
close( P7D, nosave);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:56:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/245974#M48329</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-06T13:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data for past X number of days</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/246229#M48370</link>
      <description>&lt;P&gt;Just a simple correction,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;nice solution is missing an equal sign. Line 4 should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;P7D = dt &amp;lt;&amp;lt; subset(invisible, selected columns(0), selected rows(1));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:52:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/246229#M48370</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-02-06T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data for past X number of days</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/246230#M48371</link>
      <description>&lt;P&gt;Thanks for the catch&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:54:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-for-past-X-number-of-days/m-p/246230#M48371</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-06T13:54:47Z</dc:date>
    </item>
  </channel>
</rss>

