<?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: JSL code &amp;amp; Summarize help in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820250#M99870</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp; and &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thank you both for the quick feedback and ideas. I might have been too quick to mark it as solved though because something strange just happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I tried running&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp;'s Eval( Eval Expr( )) wrapped around the summarize command, and it worked when I was testing it on the test data table (the one of just the dates), but as soon as I moved to the original data table, it stopped working, and I get the following error:&amp;nbsp;Column not found in access or evaluation of 'Year' , Year/*###*/(:Date).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Now, when I go back and try to do it on the "fake" data table of dates, I get the error again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, Your option is a possibility, but I would need to turn it from a matrix (or 1-D vector into a list of numbers) -- any quick way to do that? I need to do it because I'm using the list of years in an associative array.&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, 02 Dec 2024 21:23:06 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2024-12-02T21:23:06Z</dc:date>
    <item>
      <title>JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820212#M99862</link>
      <description>&lt;P&gt;Hi JMP community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; JMP Pro v17.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I&amp;nbsp; have a script that had been working last month, but doesn't appear to be working anymore. I have a data table where one column is named :Date (see attached data table). The following script is supposed to summarize the data table by the Year( ) of :Date and generate a list of years for the variable "yrs".&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize( dt, yrs = By( Year( :Date ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; For example, it is supposed to return a list of dates like {"2022", "2023", "2024"} and so on, because the Year( ) command is supposed to extract out just the year value from the :Date column, however it doesn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you remove the Year( ) command around :Date and run it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize( dt, yrs = By( :Date ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; The result is a list of all the individual dates, here's an excerpt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"09/29/0263", "01/30/1930", "02/11/1955", "05/03/2002", "08/13/2002", "10/19/2002",&lt;BR /&gt;"01/01/2021", "01/02/2021", "01/06/2021", "01/18/2021", "01/30/2021", "02/12/2021",&lt;BR /&gt;"02/13/2021", "02/15/2021", "03/26/2021", "03/27/2021", "03/28/2021", "03/30/2021",&lt;BR /&gt;"04/23/2021", "04/24/2021", "04/25/2021",}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; There are some mistyped dates, but this can be ignored right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I don't actually want all the individual dates, I just want a list of all the years. Unfortunately, when I try to execute yr = Year( :Date), then I get a null/empty variable for yr. This ends up not being able to be evaluated by the next By( ) command around it in the original JSL. I don't know if I need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; What I find strange is that about a month ago when I was building this code, it seemed to work just fine, but now it's not functioning like it was.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm sure I'm missing something simple that's causing this problem, but I can't figure out what it is. Or, I'm thinking about the Summarize( ) and/or how it uses the By( ) group in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any thoughts/feedback!,&lt;BR /&gt;DS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 18:31:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820212#M99862</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2024-12-02T18:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820241#M99864</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You need to Evaluate the Year function as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(Eval Expr(summarize (dt, yr = By(Year(:Date)))));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 19:12:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820241#M99864</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2024-12-02T19:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820244#M99865</link>
      <description>&lt;P&gt;I don't think you can do that with Summarize but you could use Summary with transform column if you don't want to create new column to your table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/Date.jmp");

dt_summary = dt &amp;lt;&amp;lt; Summary(
	Group(Transform Column("Year", Formula(Year(:Date)))),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	output table name("Summary of Date grouped by Year"),
	Private
);

years = dt_summary[0, 1];
Close(dt_summary, no save);

Show(years);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 19:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820244#M99865</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-02T19:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820250#M99870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp; and &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thank you both for the quick feedback and ideas. I might have been too quick to mark it as solved though because something strange just happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I tried running&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp;'s Eval( Eval Expr( )) wrapped around the summarize command, and it worked when I was testing it on the test data table (the one of just the dates), but as soon as I moved to the original data table, it stopped working, and I get the following error:&amp;nbsp;Column not found in access or evaluation of 'Year' , Year/*###*/(:Date).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Now, when I go back and try to do it on the "fake" data table of dates, I get the error again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, Your option is a possibility, but I would need to turn it from a matrix (or 1-D vector into a list of numbers) -- any quick way to do that? I need to do it because I'm using the list of years in an associative array.&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, 02 Dec 2024 21:23:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820250#M99870</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2024-12-02T21:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820253#M99872</link>
      <description>&lt;P&gt;Are the keys integers or strings in your associative array? If they are integers, you can use As List())&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/Date.jmp");

dt_summary = dt &amp;lt;&amp;lt; Summary(
	Group(Transform Column("Year", Formula(Year(:Date)))),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	output table name("Summary of Date grouped by Year"),
	Private
);

years = dt_summary[0, 1];
Close(dt_summary, no save);

show(As List(years)); // As List(years) = {263, 1930, 1955, 2002, 2021, 2022, 2023, 2024, 2025};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if they are strings, I would change the column to character and then take the values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/Date.jmp");

dt_summary = dt &amp;lt;&amp;lt; Summary(
	Group(Transform Column("Year", Formula(Year(:Date)))),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	output table name("Summary of Date grouped by Year"),
	Private
);
Column(dt_summary, 1) &amp;lt;&amp;lt; Set Data Type("Character");

years = dt_summary[0, 1];
Close(dt_summary, no save);

show(years); // years = {"263", "1930", "1955", "2002", "2021", "2022", "2023", "2024", "2025"};
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 21:52:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820253#M99872</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-02T21:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820255#M99873</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;&amp;nbsp; I&amp;nbsp; have a script that had been working last month&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;maybe due to a pre-existing column?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1733178560129.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70799i97FC07B21258F363/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1733178560129.png" alt="hogi_1-1733178560129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 22:33:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820255#M99873</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-02T22:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820257#M99874</link>
      <description>&lt;P&gt;Summarize works with Transform columns:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Hurricanes.jmp" );
dt &amp;lt;&amp;lt; Transform Column( "tmp", Formula( year(:date) ) );
Summarize(years = by (tmp));
//dt &amp;lt;&amp;lt; Delete Columns( :tmp );
Show(years)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Don't worry if you forget to delete the transform column, it will be gone after the next "open".&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 22:35:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820257#M99874</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-02T22:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820354#M99885</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks for the feedback and suggestion. I do need the years as strings because I end up using them later in a combo box, which only takes strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks for all the help and troubleshooting!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:05:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820354#M99885</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2024-12-03T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820355#M99886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; All the data tables have the same column name :Date, and they're all numeric, continuous columns, so I'm not sure why it worked before and doesn't now. And, what's strange is that it works for the Hurricanes.jmp data table, but it doesn't work for mine. I really don't understand why this happens, but it does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Anyway, the way that Jarmo suggested works well and doesn't end up being finicky like the Summarize(By( )) command.&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>Tue, 03 Dec 2024 14:21:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820355#M99886</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2024-12-03T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820356#M99887</link>
      <description>&lt;P&gt;For Hurricanes.jmp, it works due to the column &lt;FONT face="courier new,courier"&gt;:year&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;JMP reroutes the &lt;FONT face="courier new,courier"&gt;year(:date)&lt;/FONT&gt; to &lt;FONT face="courier new,courier"&gt;:year &lt;/FONT&gt;?!?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:30:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820356#M99887</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-03T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code &amp; Summarize help</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820373#M99893</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;, maybe. I have no clue, and don't understand why JSL would do something like that. I just tested that theory out, and sure enough, the Summarize command did NOT work because the column :Year was gone. So strange! And, even though the :Date column is a formula in the Hurricanes.jmp file, it doesn't matter. If the formula is removed it works just fine, but if the column :Year is deleted, it no longer works. I don't understand the JSL logic behind that, but that's the way it is.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 15:27:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-amp-Summarize-help/m-p/820373#M99893</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2024-12-03T15:27:01Z</dc:date>
    </item>
  </channel>
</rss>

