<?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: How to graph the last N values of a column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78997#M36647</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm now looking to try and modify that code so it graphs the last N non-zero values. I have several rows in a column that might have missing values and want to graph only those rows which have an entry. Right now, if there is only one or two&amp;nbsp;rows within the past N (in my case 25) that are non-zero, then it only graphs those one or two rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help/fedback is greatly appreciated. Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 09:30:13 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2018-10-16T09:30:13Z</dc:date>
    <item>
      <title>How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78923#M36615</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm still relatively new to JSL, so building my script codes as I move along.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm trying to add to a control chart window the graph of the last 25 data points in a column of M values, e.g. colum(M-25) to (M).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm thinking of modifying the chart builder script to do this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Control Chart Builder(
	Size( 534, 454 ),
	Show Two Shewhart Charts( 0 ),
	Show Control Panel( 0 ),
	Show Limit Summaries( 0 ),
	Show Capability( 0 ),
	Variables( Y( :Name( "MyColumn" ) ) ),
	Chart(
		Points( Statistic( "Individual" ) ),
		Limits( Sigma( "Moving Range" ) ),
		Warnings( Test Beyond Limits( 1 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"graph display 1 title",
			TextEditBox,
			{Set Text( "Last 25 Observations" )}
		),
		Dispatch( {}, "MyColumn Limit Summaries", OutlineBox, {Close( 1 )} )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; The problem I'm having is how to chose only those last N values to display (N could be 25 or 30 or 100). My experience with other programming languages like Igor or Matlab aren't translating over to JSL for how to graph just a subset of data from a column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If possible, I'd prefer to have it plot the data vs row index, like in the control charts, and I know the Overlay plot can do that, but I also like having the Avg show up in the graph. I would prefer to NOT plot the data as a Fit Y by X.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 16:08:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78923#M36615</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2018-10-15T16:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78924#M36616</link>
      <description>&lt;P&gt;Here is an example with Bivariate and Big Class that could be adapted:&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 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

last n = 5;
n = N Row( dt );

biv = dt &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	Where( Row() &amp;gt; (n - last n) )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is simple.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 16:16:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78924#M36616</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2018-10-15T16:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78934#M36622</link>
      <description>&lt;P&gt;Worked! Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had to modify slightly for the specifics, but worked.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 17:33:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78934#M36622</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2018-10-15T17:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78997#M36647</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm now looking to try and modify that code so it graphs the last N non-zero values. I have several rows in a column that might have missing values and want to graph only those rows which have an entry. Right now, if there is only one or two&amp;nbsp;rows within the past N (in my case 25) that are non-zero, then it only graphs those one or two rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help/fedback is greatly appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 09:30:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/78997#M36647</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2018-10-16T09:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/79016#M36655</link>
      <description>&lt;P&gt;Here is a simple modification to the script that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt; wrote, that finds the row that has the last x number of nonzero values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:weight[38] = 0;

last n = 0;

For( i = N Rows( dt ), i &amp;gt;= 1, i--,
	If( :weight[i] &amp;gt; 0, last n++ );
	If( last n == 5, Break() );
);
last n = N Row( dt ) - i;
n = N Row( dt );

biv = dt &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	Where( Row() &amp;gt; (n - last n) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:37:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/79016#M36655</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-10-16T13:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/79951#M36857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;, thanks for the suggestion. I ended up slightly changing the code so that it looked for empty entries rather than just non-zero entries. Your method worked and I just needed to slightly adapt it to my specific situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lastNmiss = 0;

For( ii = N Rows( dt ), ii &amp;gt;= 1, ii--,
	If( IsMissing(dt:weight[ii])!=1, lastNmiss++ );
	If( lastnmiss == 8, Break() );
);
lastNmiss = N Row( dt ) - ii;
n = N Row( dt );

biv = dt &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	Where( Row() &amp;gt; (n - lastnmiss) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 18:59:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/79951#M36857</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2018-10-22T18:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84028#M37740</link>
      <description>How to graph data from the data table with one particular column satisfies given if condition?</description>
      <pubDate>Fri, 23 Nov 2018 07:42:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84028#M37740</guid>
      <dc:creator>EMC2</dc:creator>
      <dc:date>2018-11-23T07:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84029#M37741</link>
      <description>Hello Sir, I want to draw chart of a given big data set. But i need to check one particular column satisfies if condition and then consider corresponding rows for plotting graph. I would like to do this through jsl script. Could you help me as am very beginner. Thanks!</description>
      <pubDate>Fri, 23 Nov 2018 07:54:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84029#M37741</guid>
      <dc:creator>EMC2</dc:creator>
      <dc:date>2018-11-23T07:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84031#M37743</link>
      <description>&lt;P&gt;This seems to be a different question from the topic of the thread, but maybe try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names DefaultToHere(1);

// Open a table and give it a table reference ('dt')
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Get a list of all the columns in the table
cols = dt &amp;lt;&amp;lt; getColumnNames("String");

// Define any logical condition that identifies one or more columns by its name
targetCols = {};
for(c=1, c&amp;lt;=NItems(cols), c++, if(Contains(cols[c], "gh"), InsertInto(targetCols, cols[c])));

// Make a plot using'taregtCols' as the y variables
biv = dt &amp;lt;&amp;lt; OneWay(X(:sex), Y(Eval(targetCols)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Nov 2018 08:36:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84031#M37743</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-11-23T08:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84040#M37744</link>
      <description>&lt;P&gt;Thanks! Not sure i submitted my question correctly. I want to draw chart of a given big data set. But i need to check one particular column satisfies if condition and then if condition is satisfied then consider corresponding rows for plotting graph. I would like to do this through jsl script. Could you help me as am very beginner. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 09:18:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84040#M37744</guid>
      <dc:creator>EMC2</dc:creator>
      <dc:date>2018-11-23T09:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84061#M37750</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names DefaultToHere(1);

// Open a table and give it a table reference ('dt')
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Select the data you do not want, and exclude them
dt &amp;lt;&amp;lt; select where( :sex == "F" );
dt &amp;lt;&amp;lt; hide and exclude;

// Clear the selections
dt &amp;lt;&amp;lt; clear select;

// Create the chart, only none excluded/hidden rows will be displayed
dt &amp;lt;&amp;lt; Graph Builder(
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Nov 2018 14:00:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84061#M37750</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-11-23T14:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84078#M37758</link>
      <description>Thanks!</description>
      <pubDate>Fri, 23 Nov 2018 17:22:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/84078#M37758</guid>
      <dc:creator>EMC2</dc:creator>
      <dc:date>2018-11-23T17:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/401841#M65273</link>
      <description>&lt;P&gt;Can you share the exact code you used to control chart the last N column please. I'm not having luck for the modification.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 19:54:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/401841#M65273</guid>
      <dc:creator>Godwin</dc:creator>
      <dc:date>2021-07-16T19:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to graph the last N values of a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/402018#M65291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/29843"&gt;@Godwin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Each particular situation is a little different and might require a slight modification of the code for the specifics at hand. If you can share a data table and your code that you're working with, that might help me and others on this thread to better address the specifics of what you're trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:39:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-graph-the-last-N-values-of-a-column/m-p/402018#M65291</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-07-19T13:39:21Z</dc:date>
    </item>
  </channel>
</rss>

